Hi,

sorry, I posted my messages through google groups where the original 
context is still visible; I suspect you do not, so here is the original 
requirement:

I have two tables aggregated by a foreign key. Sometimes I just need table 
A, sometimes I want the corresponding record from table B to be filled in a 
member variable. So my SELECTs are like
create.select().from(A).where(...)
or
create.select().from(A).leftJoin(B).on(A.B_ID.eq(B.B_ID))

Now, I want the RecordMapper to decide wether to fill a member of object A 
with an object B created from the record based on the existance of B.B_ID 
in the record. I solved this with your suggestion of:

if (B.B_ID.equals(record.field(B.B_ID))) { ... }

The field() method call produces ambiguity warnings (although they are in 
place to prevent ambiguity), 
and while will already not be obvious to others what that condition is 
intended to do, with https://github.com/jOOQ/jOOQ/issues/4477 there will 
also be an exceptin thrown and the code will get even more complicated.

So the question is, is there a better way to do this, and/or would it be 
sensible to get an api for this (I could of course add this to our 
JooqUtils class which is atm very small, fortunately ;-))

-- 
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