2018-02-16 10:21 GMT+01:00 Jason Bennett <[email protected]>:

>  I agree it makes sense, although it might be nice if jOOQ gave a specific
> error message when you alias some parts of the query, and not others.
>

What specificity were you missing from  *Ambiguous match found for id. Both
"child"."id" and "parent"."id" match" *?


> fetchMap is ok, but the main issue is I have no key. The only way to get
> the keys is to iterate through the entrySet, which isn't the cleanest code.
> This is a lot easier in something like Kotlin, where you can give me a pair
> of the parent and a list of children. I suspect in Java, unless you want to
> have a jOOQ pair type, we're stuck with the map.
>

> I did experiment with fetchParent and fetchChildren, although my main
> concern there is the second query. Still, that makes my code a lot cleaner,
> at the expense of slightly more DB time.
>

That's never an option.


> I do with that the documentation was a little clearer about my options.
> All of this stuff is in there somewhere, but it's a little scattered.
>

This is one way to see it. Another one is: Thus far, you haven't described
to me in clear words what *exactly* you'd like to do. E.g. what would the
ideal jOOQ client code look like, to you? Without a clear picture of the
ideal solution, how could you possibly find the ideal solution? How could I
possibly help you find it?

What does it mean that the "main issue is not having a key"? A key to what?
Why is a "pair" better than a Map.Entry? I'm assuming you're already lost
in your exploration of possibilities, describing your attempts to find the
way out of this "forest". It would be much better to reset your
expectations and start again from the ideal solution, display that, and
then ask - how can I best get there. Quite possibly, there is a jOOQ
feature I could show you, or a third party tool, or I could add a feature
request.

Now obviously, what I *think* you want (because that's what most people
want who are criticising the fetchGroups API) is to materialise an object
graph (like in an ORM), and indeed, jOOQ doesn't offer too much help in
that area out of the box. Thus far, the goto workaround was to use a third
party library like simpleflatmapper:
http://simpleflatmapper.org/0106-getting-started-jooq.html

Cheers,
Lukas

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to