I am trying to insert the records using batchStore using jooq. I need to
know how we can update the record on unique constraint, currently it is
throwing
an exception that the record already exists
SQL Error [23505]: ERROR: duplicate key value violates unique constraint
Below is the code
DSLContext create = getDSLContext();
List<UserRecord> userRecordList = new ArrayList<>();
for (Users user : model.getUsers()) {
User record = create.newRecord(user);
userRecordList.add(record);
}
create.batchStore(userRecordList).execute();
Currently it is inserting the records fine, but when duplicate record found
on the basis of unique constraint it should update the 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 [email protected].
For more options, visit https://groups.google.com/d/optout.