Does something like
select(CHILD)from().fetchMap(parent.EXTERAL_ID)
work?

> On Feb 15, 2018, at 11:03 AM, Jason Bennett <jaso...@gmail.com> wrote:
> 
> Here's where I've ended up:
> 
> com.ep.core.project.jooq.tables.ProductionEntity parent = 
> PRODUCTION_ENTITY.as("parent");
> com.ep.core.project.jooq.tables.ProductionEntity child = 
> PRODUCTION_ENTITY.as("child");
> 
> Record7<Long, UUID, String, String, OffsetDateTime, OffsetDateTime, UUID> r =
>         this.create.select(child.ID,
>                            child.EXTERNAL_ID,
>                            child.NAME,
>                            child.SLUG,
>                            child.CREATED,
>                            child.UPDATED,
>                            parent.EXTERNAL_ID)
>                    .from(child)
>                    .leftJoin(parent)
>                    .on(child.PARENT_PRODUCTION_ENTITY_ID.eq(parent.ID))
>                    .where(child.NAME.eq(name))
>                    .fetchOne();
> 
> What I would love is to somehow get a parent object and a separate UUID out 
> of that query, without having to resort to that ugly Result object.
> 
> 
> 
> 
> On Thursday, February 15, 2018 at 12:20:49 AM UTC-8, Lukas Eder wrote:
> This should work if either:
> 
> 1. The columns are fully qualified
> 2. The columns are renamed
> 
> How di you run your query and how did you call fetchGroups()?
> 
> 2018-02-14 21:14 GMT+01:00 <jas...@gmail.com <>>:
> Normally when I do a join query, I just use fetchGroups() and fetch the 
> records into their respective types, then iterate across entryKey() - no 
> problem.
> 
> When I do this with a recursive join, however, jOOQ appears to get confused, 
> and cannot distinguish between the child record and the parent record (I 
> assume since the column names are the same). What's the best way to fetch 
> this?
> 
> -- 
> 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 jooq-user+...@googlegroups.com <>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.
> 
> 
> -- 
> 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 jooq-user+unsubscr...@googlegroups.com 
> <mailto:jooq-user+unsubscr...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
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 jooq-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to