2013/10/17 Marko Topolnik <[email protected]>
>
>
> On Thursday, October 17, 2013 10:59:03 AM UTC+2, Lukas Eder wrote:
>>
>> Hello,
>>
>> A similar problem has been reported before:
>> https://groups.google.com/**forum/#!topic/jooq-user/_cp2-**
>> mrtZ7k/discussion<https://groups.google.com/forum/#!topic/jooq-user/_cp2-mrtZ7k/discussion>
>> .
>>
>> It has lead to this feature requests (among others):
>> -
>> https://github.com/jOOQ/jOOQ/**issues/2700<https://github.com/jOOQ/jOOQ/issues/2700>
>> -
>> https://github.com/jOOQ/**jOOQ/issues/2702<https://github.com/jOOQ/jOOQ/issues/2702>
>>
>
> I was quite convinced that I'm not the first one with this issue, but I
> unfortunately failed to pinpoint the earlier posts, sorry :)
>
No worries! I just tend to link to these things to create more cohesion
between threads. This helps me find stuff, later on.
>
>
>> In the mean time, your workaround is one way to do this, another would be
>> this:
>>
>> final Record inputRec = sql.newRecord(USER);
>> inputRec.from(user);
>> for (Field<?> f : inputRec.fields()) {
>> if (inputRec.getValue(f) == null)
>> inputRec.changed(false);
>> }
>> inputRec.store();
>>
>
> Great, I was experimenting with this approach involving changed. However,
> I overlooked the store method and used creat.insertInto(...), which
> always inserted nulls regardless of their *changed* status.
>
Yes, if you're into CRUD, jOOQ's UpdatableRecord has a couple of useful
methods:
http://www.jooq.org/javadoc/latest/org/jooq/UpdatableRecord.html
The explicit DSL API (e.g. create.insertInto(...) ) does not communicate
with UpdatableRecord's changed flags. They're merely used for the insert(),
update(), store() methods.
--
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/groups/opt_out.