Thanks for the update. That's indeed one option to prevent setting the
identity value. You could also reset it prior to storing using
record.reset(Field). Or you could implement a RecordListener that does this
prior to each store(), insert() call.
Note, the reason why jOOQ sets the identity value by default is because
some databases allow for explicit overriding the identity value. I know
that SQL Server is a bit special here, but I'm sure that an "emulated"
identity (DEFAULT with sequence generated value) can also be overridden, I
think - so jOOQ doesn't make any assumptions and just does what users ask
it to do, i.e. set the identity value...
Hope this helps,
2016-10-14 13:09 GMT+02:00 Denis Miorandi <denis.miora...@gmail.com>:
> ok, solved myself. Using jooq 3.8 is possible to pass to record.insert(xx)
> a Collection, so this method do the work of removing identity
> preserving all fields except identity
> Identity<?, ?> identity=rec.getTable().getIdentity();
> return Stream.of(rec.fields())
> Il giorno giovedì 13 ottobre 2016 17:27:53 UTC+2, Denis Miorandi ha
>> I'm using dslCtx.createNewRecord(TABLE) to create a record, mapping
>> from my objectgraph (not jooq pojos) to jooq record. Record is an
>> UpdatableRecord with IDENTITY.
>> Issue is my mapper map also KEY/IDENTITY that is null so operation that
>> is an insert (due to null key) fail cause jooq specify ID on an identity
>> Question is modify my mapper the only way (avoiding to place identity
>> field on record if value is null) or
>> are there some other way to do automatically before record.insert(), i.e.
>> removing identity field from record?
>> All in all can I remove a field from jooq record?
> 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 jooq-user+unsubscr...@googlegroups.com.
> 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
For more options, visit https://groups.google.com/d/optout.