My mistake - assertFalse(record.changed(TABLE1.DATE1)) - correct to me. Well, for me changed - that field was actually changed by setter. In this case it was not.
I agree, stable SQL is good point, but sometimes it is necessary not to generate it in order not to erase untouched fields. Coould you comment here or on gitHub the way you solve this problem? Will changed() be always taken into account or there will be some flexibility for a progammer? The way to tell JOOQ to consider really changed field? Regards, Oleg On Fri, Jun 5, 2015 at 4:22 PM, Lukas Eder <[email protected]> wrote: > Oleg, maybe we're a bit out of sync here... :) > > 2015-06-05 15:15 GMT+02:00 Oleg Kuznetsov <[email protected]>: > >> Hi Lukas, >> >> I completely agree with your point, but it does not equal to mine :) >> >> assertFalse(record.get(record.changed(TABLE1.DATE1))) - this is correct >> to me. >> > > How does this work? record.change(Field<?>) returns a boolean, and there's > no record.get(boolean) method. At least not in jOOQ's API... > > >> But as a user of JOOQ, I expect that if column is not changed in record, >> then update SQL generated on this record will not contain 'SET date1 = >> null'. >> > > Absolutely, and we've implemented that (according to our understanding) in > 3.6.0: > https://github.com/jOOQ/jOOQ/issues/4161 > > But the point here is: What do you mean by "column is not changed"? The > record's setter for a field is called: setValue(). This will always set the > "changed" flag to true for that column, regardless if the value "changes". > There are several reasons for this: > > 1. You may have triggers that depend on this > 2. You may want to omit DEFAULT expressions from applying > 3. You may want to enforce a certain type of SQL statement, to prevent > excessive hard-parsing of different possible insert / update statement > combinations. This can help prevent cursor cache contention, e.g. in Oracle > > So, do we mean the same thing when we say "changed" ? > > -- > You received this message because you are subscribed to a topic in the > Google Groups "jOOQ User Group" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/jooq-user/DIw1KfQaCs0/unsubscribe. > To unsubscribe from this group and all its topics, 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.
