I think JOOQ cannot detect changes made in DTO, because there is no 
connection between it and jooq record.

As I understand, since 3.6 changes made via record will cause update only 
changed fields.

Also, converting DTO, where number of fields is less than in JOOQ record, 
to JOOQ record will also cause update only fields contained in DTO.

среда, 10 июня 2015 г., 18:30:28 UTC+3 пользователь Robert DiFalco написал:
>
> Sorry for belaboring this but I still don't see a clear answer to the 
> question. I suppose I could just look at the code but...
>
> Many of us have beans whose fields we may populate from the database. Then 
> a user may modify some of the field in this bean/record. When we then do an 
> update are only the fields that have been modified updated for that row? I 
> would expect JOOQ to only update the fields that have been modified in 
> code, not those that were retrieved from the database and have not been 
> "changed". 
>
> On Friday, June 5, 2015 at 6:39:32 AM UTC-7, Lukas Eder wrote:
>>
>>
>>
>> 2015-06-05 15:32 GMT+02:00 Oleg Kuznetsov <[email protected]>:
>>
>>> 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?
>>>
>>
>> The idea is that whenever "changed" information is available, it should 
>> be considered and only "changed" values should make it into SQL statements 
>> (sometimes there are bugs, of course).
>> You have full control over those "changed" flags via *Record.changed(Field, 
>> boolean)*:
>>
>> http://www.jooq.org/javadoc/latest/org/jooq/Record.html#changed-org.jooq.Field-boolean-
>>
>> Is that what you were looking for?
>>
>

-- 
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.

Reply via email to