Hi,

I have a postgres table which has an autogenerated primary key and some 
other columns.
i have used jooq's code generator to create generate a record class for 
this table. 
creating a new record and inserting it using record.insert works fine 
without setting a value for the autogenerated key.
if i create a list of records and use DSL.batchInsert i get a "cannot 
translate a null" exception.

SampleRecord r = new SampleRecord();
// set only col1 and not the autogenerated primary key 
r.setCol1(0);
r.attach(config);
r.insert(); // this works fine

Set<SampleRecord> rs = new HashSet<>();

SampleRecord r1 = new SampleRecord();
r1.setCol1(1);
r1.attach(config);
rs.add(r1);


SampleRecord r2 = new SampleRecord();
r2.setCol1(2);
r2.attach(config);
rs.add(r2);

dslContext.batchInsert(rs).execute(); // this throws a "cannot translate 
null exception"


Thanks,
Gokul

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