Hello, I'm sorry for the delay. You're right, the changed() flag should affect the query - this is a bug: https://github.com/jOOQ/jOOQ/issues/4161
As a workaround, you can either set each column individually, or use DSLContext.executeUpdate(UpdatableRecord), which already implements the query as you expected it: http://www.jooq.org/javadoc/latest/org/jooq/DSLContext.html#executeUpdate-R- Hope this helped, Lukas 2015-03-24 15:34 GMT+01:00 Oleg <[email protected]>: > Hi > > I have the following code tfor table ENTITY_TABLE = (id, name, code) > > Record record = dsl.newRecord(getTable(), entity); > dsl.update(getTable()) > .set(record) > .where(getTableId().eq(record.getValue(getTableId()))) > .execute(); > > > and DTO Entity (id, name) - using which JOOQ record is created > > > > This expression generates UPDATE for 3 fields (id, name, code) instead of 2. > > > Hence, code value in DB become null. > > > I would expect only 2 fields to be updated. > > > I tried record.changed(CODE, false), but this did not word. > > > Is there a way to generate update for only those columns that were actually > found in DTO without manual setting them? > > > > Regards. > > -- > 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.
