Interface RDBMSActionStrategyInterface
- All Known Implementing Classes:
BaseRDBMSActionStrategy,MySQLFullTextIndexFieldStrategy,PostgreSQLRDBMSActionStrategy,SQLiteRDBMSActionStrategy
public interface RDBMSActionStrategyInterface
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface -
Method Summary
Modifier and TypeMethodDescriptionappendCriterionToWhereClause(QFilterCriteria criterion, StringBuilder clause, String column, List<Serializable> values, QFieldMetaData field) modifies the clause StringBuilder (appending to it) returning the number of expected number of params to binddefault ConsistentReadStartbeginConsistentRead(Connection connection, ConsistentReadInput input) Start a transaction on the (autocommit-off) connection, such that every read through it sees one snapshot - or, for a database with no better way, at least asks for REPEATABLE READ isolation, and reports BEST_EFFORT.default voidconfigureStatementForLargeResults(Connection connection, PreparedStatement statement) Hook for a vendor strategy to configure a prepared statement for a query that carries the POTENTIALLY_LARGE_NUMBER_OF_RESULTS hint, so that the driver streams the results rather than buffering them all in memory.voidexecuteBatchUpdate(Connection connection, String updateSQL, List<List<Serializable>> values) executeInsertForGeneratedIds(Connection connection, String sql, List<Object> params, QFieldMetaData primaryKeyField) voidexecuteStatement(PreparedStatement statement, CharSequence sql, RDBMSActionStrategyInterface.ResultSetProcessor processor, Object... params) executeUpdate(Connection connection, String sql, List<Object> params) executeUpdateForRowCount(Connection connection, String sql, Object... params) default StringgetAggregateExpression(AggregateOperator operator, String columnExpression, String otherColumnExpression, Aggregate aggregate, RDBMSBackendMetaData backend, List<Serializable> params) Render the complete aggregate expression.getFieldValueFromResultSet(QFieldType type, ResultSet resultSet, int i) default StringgetGroupByBucketExpression(GroupBy group, String column, QFieldType sourceType, RDBMSBackendMetaData backend, List<Serializable> params) Render a bucket around an already resolved SQL column.default StringGet the string to use for quoting identifiers (table names, column names).default StringInsert one row using only native defaults.getPageSize(AbstractActionInput actionInput) default StringgetSampledTableExpression(String table, String alias, BigDecimal percent, List<Serializable> params) Sample only the main table; called before rendering any joins.default Set<AggregateCapability> Optional extensions; third-party strategies remain source compatible.default StringjsonMergeAssignment(String column) Atomic merge assignment for non-null keys and removed keys.default StringPlaceholder for a serialized JSON object.default StringjsonPathExpression(String column, JsonPathStorage storage, QFieldType type) Render a typed JSON path.default StringjsonPathPredicate(String column, QFieldMetaData field, QFilterCriteria criterion, List<Serializable> values) Optional indexed JSON predicate.default booleanWhether this database supports SELECT ...
-
Method Details
-
appendCriterionToWhereClause
Integer appendCriterionToWhereClause(QFilterCriteria criterion, StringBuilder clause, String column, List<Serializable> values, QFieldMetaData field) modifies the clause StringBuilder (appending to it) returning the number of expected number of params to bind -
getFieldValueFromResultSet
Serializable getFieldValueFromResultSet(QFieldType type, ResultSet resultSet, int i) throws SQLException - Throws:
SQLException
-
executeUpdate
PreparedStatement executeUpdate(Connection connection, String sql, List<Object> params) throws SQLException - Throws:
SQLException
-
executeBatchUpdate
void executeBatchUpdate(Connection connection, String updateSQL, List<List<Serializable>> values) throws SQLException - Throws:
SQLException
-
executeInsertForGeneratedIds
List<Serializable> executeInsertForGeneratedIds(Connection connection, String sql, List<Object> params, QFieldMetaData primaryKeyField) throws SQLException - Throws:
SQLException
-
executeUpdateForRowCount
Integer executeUpdateForRowCount(Connection connection, String sql, Object... params) throws SQLException - Throws:
SQLException
-
executeStatement
void executeStatement(PreparedStatement statement, CharSequence sql, RDBMSActionStrategyInterface.ResultSetProcessor processor, Object... params) throws SQLException, QException - Throws:
SQLExceptionQException
-
getPageSize
-
supportsForUpdateSkipLocked
default boolean supportsForUpdateSkipLocked()Whether this database supports SELECT ... FOR UPDATE SKIP LOCKED (for QueryLockMode.FOR_UPDATE_SKIP_LOCKED). False by default. -
getIdentifierQuoteString
Get the string to use for quoting identifiers (table names, column names). Default is backtick for MySQL/H2/SQLite. PostgreSQL should return empty string or double-quote. -
configureStatementForLargeResults
default void configureStatementForLargeResults(Connection connection, PreparedStatement statement) throws SQLException Hook for a vendor strategy to configure a prepared statement for a query that carries the POTENTIALLY_LARGE_NUMBER_OF_RESULTS hint, so that the driver streams the results rather than buffering them all in memory. Default: no-op.- Throws:
SQLException
-
getInsertDefaultValuesClause
Insert one row using only native defaults. The default syntax is MySQL/H2. -
beginConsistentRead
default ConsistentReadStart beginConsistentRead(Connection connection, ConsistentReadInput input) throws SQLException Start a transaction on the (autocommit-off) connection, such that every read through it sees one snapshot - or, for a database with no better way, at least asks for REPEATABLE READ isolation, and reports BEST_EFFORT. Vendor-specific strategies override this with the vendor's snapshot syntax. Called by RDBMSBackendModule.openConsistentReadTransaction, before any statement has run on the connection.- Throws:
SQLException
-
jsonPathExpression
Render a typed JSON path. Unsupported dialects fail explicitly. -
jsonObjectPlaceholder
Placeholder for a serialized JSON object. -
jsonMergeAssignment
-
jsonPathPredicate
default String jsonPathPredicate(String column, QFieldMetaData field, QFilterCriteria criterion, List<Serializable> values) Optional indexed JSON predicate. Values are already typed; replace bind values when used. -
getSupportedAggregateCapabilities
Optional extensions; third-party strategies remain source compatible. -
getAggregateExpression
default String getAggregateExpression(AggregateOperator operator, String columnExpression, String otherColumnExpression, Aggregate aggregate, RDBMSBackendMetaData backend, List<Serializable> params) Render the complete aggregate expression. Operands are resolved SQL, never client field names. -
getGroupByBucketExpression
default String getGroupByBucketExpression(GroupBy group, String column, QFieldType sourceType, RDBMSBackendMetaData backend, List<Serializable> params) Render a bucket around an already resolved SQL column. -
getSampledTableExpression
default String getSampledTableExpression(String table, String alias, BigDecimal percent, List<Serializable> params) Sample only the main table; called before rendering any joins.
-