Hi Boris,

Thanks a lot for your message. Quick question first: Why are you not using
the code generator? You will get a *much* better experience with jOOQ in
general, if you're using the code generator. Omitting the code generator
usually only makes sense when your schema is dynamic, and not known at
compile time.

Meanwhile, regarding your particular issue, there's a common confusion
between the plain SQL API (which you were using), and the API to construct
references from identifiers (which you should be using).

See the relevant sections of the documentation here:
- https://www.jooq.org/doc/latest/manual/sql-building/plain-sql/
- https://www.jooq.org/doc/latest/manual/sql-building/names/

Or this blog post:
- https://blog.jooq.org/2020/04/03/whats-a-string-in-the-jooq-api/

I hope this helps,
Lukas

On Fri, May 28, 2021 at 8:48 PM Boris Heismann <[email protected]>
wrote:

> Hi,
>
> I'm evaluating jOOQ pro trial 3.14.11. I'm playing with it without to use
> code generator. Using fetch.intoMap("author.id") produces:
> java.lang.IllegalArgumentException: Field (null) is not contained in Row
> ("author"."id", "author"."first_name", "author"."last_name", "book"."id",
> "book"."author_id", "book"."name", "book"."pubshing_date")
>
> The RDBMS used is MariaDB. The piece of code is:
>         SelectFinalStep<Record> select = dslContext.select()
>                 .from(table("author")
>                         .join(table("book"))
>                         .on(field("book.author_id")
>                                 .eq(field("author.id"))))
>                 .where(field("book.author_id")
>                         .eq(1));
> select.fetch().intoMap("author.id");
>
> Using select.fetch().intoMap("id") generates a warning that field "id" is
> ambiguous because the table "book" uses it as well:
> INFO: Ambiguous match found for id. Both "author"."id" and "book"."id"
> match.
>
> What is the right proceeding here?
>
> Best regards.
>
> Boris
>
>
> --
> 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].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jooq-user/9c11fa4c-a325-4bd3-8784-54989d926c26n%40googlegroups.com
> <https://groups.google.com/d/msgid/jooq-user/9c11fa4c-a325-4bd3-8784-54989d926c26n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jooq-user/CAB4ELO5yGS-upLv7bo9CN%3DE045%3D2Pr1kXwbucRiXA_JQe7KLnw%40mail.gmail.com.

Reply via email to