I have a table with an autoincrementing primary key. I would like to be 
able to create a record object (using the generated record class) and 
insert it into the table like so:

create.insertInto(Tables.FOO)
    .set(record)
    .returning(FOO.ID)
    .fetchOne();


I was guessing that if the ID field in the 'record' object was null, then a 
new record would be inserted. Instead I'm getting an SQLException telling 
me that I can't insert an explicit value of the identity column.

I don't know if this is reasonable or not, but would it be possible for 
jooq to recognize a situation like this and leave the ID column off of the 
generated sql statement? If that isn't a good idea, then is there a better 
way for me to do this without just having to explicitly list every column 
of the table in the code?

Thanks

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