Skip to content

Commit

Permalink
Add Support to Upsert/Insert Ignore on PDB
Browse files Browse the repository at this point in the history
- Fix H2Engine variable initialization
  • Loading branch information
victorcmg-fdz committed Jun 29, 2023
1 parent 5ad2cb6 commit 07fbbbd
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ protected MappedEntity createPreparedStatementForInserts(final DbEntity entity)
psWithAutoInc = this.conn.prepareStatement(statementWithAutoInt, generateKeys);

final String statementWithMerge = buildUpsertStatement(entity, columns, values);
psMerge = this.conn.prepareStatement(statementWithMerge, generateKeys);
psMerge = this.conn.prepareStatement(statementWithMerge);

return new MappedEntity()
.setInsert(ps)
Expand All @@ -497,7 +497,8 @@ protected MappedEntity createPreparedStatementForInserts(final DbEntity entity)
return new MappedEntity()
.setInsert(ps)
.setInsertReturning(psReturn)
.setInsertWithAutoInc(psWithAutoInc);
.setInsertWithAutoInc(psWithAutoInc)
.setAutoIncColumn(columnWithAutoIncName);

} catch (final SQLException ex) {
throw new DatabaseEngineException("Something went wrong handling statement", ex);
Expand Down

0 comments on commit 07fbbbd

Please sign in to comment.