Package com.sap.cds.jdbc.postgresql
Class PostgreSqlStatementResolver
java.lang.Object
com.sap.cds.jdbc.generic.GenericStatementResolver
com.sap.cds.jdbc.postgresql.PostgreSqlStatementResolver
- All Implemented Interfaces:
StatementResolver
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlockMode(CqnLock.Mode mode) timeoutClause(int timeoutSeconds) upsert(String table, Stream<String> keyColumns, Stream<String> upsertColumns, Stream<String> upsertValues) PostgreSQL: INSERT INTO with ON CONFLICT DO UPDATE ON CONFLICT can be used to specify an alternative action to raising a unique constraint or exclusion constraint violation error.Methods inherited from class com.sap.cds.jdbc.generic.GenericStatementResolver
applyTransformationsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.sap.cds.jdbc.spi.StatementResolver
collate, collate, hints, lockClause, preOptimize, statementWideCollation, supportsStatementWideCollation
-
Constructor Details
-
PostgreSqlStatementResolver
public PostgreSqlStatementResolver()
-
-
Method Details
-
upsert
public String upsert(String table, Stream<String> keyColumns, Stream<String> upsertColumns, Stream<String> upsertValues) PostgreSQL: INSERT INTO with ON CONFLICT DO UPDATE ON CONFLICT can be used to specify an alternative action to raising a unique constraint or exclusion constraint violation error. For each individual row proposed for insertion, either the insertion proceeds, or, if an arbiter constraint or index specified by conflict_target is violated, the alternative conflict_action is taken. ON CONFLICT DO UPDATE updates the existing row that conflicts with the row proposed for insertion as its alternative action. ON CONFLICT DO UPDATE guarantees an atomic INSERT or UPDATE outcome; provided there is no independent error, one of those two outcomes is guaranteed, even under high concurrency. This is also known as UPSERT — “UPDATE or INSERT”. https://www.postgresql.org/docs/current/sql-insert.html#SQL-ON-CONFLICT -
lockMode
-
timeoutClause
-
deleteAll
-