Hello Nico, You could check for equality after getting the field from the record:
B.B_ID.equals(record.field(B.B_ID)) That might look a bit fishy at first but it makes sense as it uses the API contract stating that record.field(Field) returns a Field of the same Field.getName(), regardless if the resulting Field really equals() the argument field. Hope this helps, Lukas 2016-06-23 11:39 GMT+02:00 McNetic <[email protected]>: > Hi, > > 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. Is there any way to determine if B.B_ID is present? > record.field(B.B_ID) > will always be != null because of A.B_ID also being present in the record. > record.field("B.B_ID") > is always null. > > Is there any other way to achieve what I want to do? > > Thank you very much > > Nico > > -- > 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. > -- 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.
