Skip to content

Commit

Permalink
Revert "Add Support to Upsert/Insert Ignore on PDB"
Browse files Browse the repository at this point in the history
This reverts commit 5ad2cb6.
  • Loading branch information
victorcmg-fdz committed Jul 3, 2023
1 parent 511f56b commit 8738daa
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ protected MappedEntity createPreparedStatementForInserts(final DbEntity entity)
.setUpsert(psUpsert);

} catch (final IllegalArgumentException e) {
logger.error("Returning entity without an UPSERT/MERGE prepared statement.", e);
logger.trace("Returning entity without an UPSERT/MERGE prepared statement.");
return new MappedEntity()
.setInsert(ps)
.setInsertReturning(psReturn)
Expand Down Expand Up @@ -472,7 +472,7 @@ private String buildUpsertStatement(final DbEntity entity, final List<String> co
throw new IllegalArgumentException("The MERGE command was not created because the entity has no primary keys. Skipping statement creation.");
}

final List<String> merge = new ArrayList<>();
List<String> merge = new ArrayList<>();
merge.add("MERGE INTO " + quotize(entity.getName()) + " AS dest");

merge.add("USING (VALUES(" + join(values, ", ") + ")) AS src (" + join(columns, ", ") + ")");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ protected MappedEntity createPreparedStatementForInserts(final DbEntity entity)
.setUpsert(psMerge);

} catch (final IllegalArgumentException e) {
logger.error("Returning entity without an UPSERT/MERGE prepared statement.", e);
logger.trace("Returning entity without an UPSERT/MERGE prepared statement.");
return new MappedEntity()
.setInsert(ps)
.setInsertReturning(psReturn)
Expand All @@ -516,7 +516,7 @@ protected MappedEntity createPreparedStatementForInserts(final DbEntity entity)
private String buildUpsertStatement(final DbEntity entity, final List<String> columns, final List<String> values) {

if (entity.getPkFields().isEmpty() || columns.isEmpty() || values.isEmpty()) {
throw new IllegalArgumentException("The MERGE command was not created because the entity has no primary keys. Skipping statement creation.");
return "";
}

final List<String> mergeInto = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ protected MappedEntity createPreparedStatementForInserts(final DbEntity entity)
.setUpsert(psUpsert);

} catch (final IllegalArgumentException e) {
logger.error("Returning entity without an UPSERT/MERGE prepared statement.", e);
logger.trace("Returning entity without an UPSERT/MERGE prepared statement.");
return new MappedEntity()
.setInsert(ps)
.setInsertReturning(psReturn)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ protected MappedEntity createPreparedStatementForInserts(final DbEntity entity)
.setAutoIncColumn(returning);

} catch (final IllegalArgumentException e) {
logger.error("Returning entity without an UPSERT/MERGE prepared statement.", e);
logger.trace("Returning entity without an UPSERT/MERGE prepared statement.");
return new MappedEntity()
.setInsert(ps)
.setInsertReturning(psReturn)
Expand Down

0 comments on commit 8738daa

Please sign in to comment.