That's a bit hypothetical, as it's pseudo-code (I guess)? Is Entity a Record? What's the DDL of the table? Is "value" a nullable column or not? How do you set "value = null" in real code? If it's not a Record, you can't pass it to the set(...) method.
2015-06-11 12:37 GMT+02:00 Oleg <[email protected]>: > What will happen in this case: > > Entity e = new Entity(id = 1, value = null); > String sql = dsl.update(ENTITY_RECORD).set(e).where(...).getSql(); > > I believe that sql should be like UPDATE entity SET id = 1, value = null > ... but 4a does not mean it, because NULL is excluded as not changed. > > четверг, 11 июня 2015 г., 13:28:44 UTC+3 пользователь Lukas Eder написал: > >> >> >> 2015-06-11 12:01 GMT+02:00 Oleg <[email protected]>: >> >>> Hi Lukas >>> >>> Just to clarify: >>> >>> >> 4. The Record.from() method simply uses reflection to take each >>> attribute from your POJO and set the corresponding value of your record >>> using setValue(), unless: >>> >>> >> a) The value is null and the corresponding Field is NOT NULL >>> >>> That means that if POJO has field with null value, than record filed >>> will be unchanged after Record.from() ? It shold be changed. >>> >> >> If and only if the Field is a NOT NULL field. Details here: >> >> - https://github.com/jOOQ/jOOQ/issues/2700 >> - https://github.com/jOOQ/jOOQ/issues/3582 >> >> -- > 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.
