I think that is very simple, but I cannot find anything simple in the docs.
How optimal get one Entry (Record) by id with JOOQ?
Something like for creation of Record:
factory.newRecord(MY_TABLE);
also
MyTableRecord record = factory.selectRecord(MY_TABLE.ID.like(id));
Apart from what yellow suggested in his answer, you can also use this "short form" here:
MyTableRecord record = factory.fetchOne(MY_TABLE, MY_TABLE.ID.like(id));
With jOOQ 2.x's Factory.fetchOne(Table, Condition)
or jOOQ 3.x's DSLContext.fetchOne(Table, Condition)
method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With