Class BaseRDBMSActionStrategy
java.lang.Object
com.kingsrook.qqq.backend.module.rdbms.strategy.BaseRDBMSActionStrategy
- All Implemented Interfaces:
RDBMSActionStrategyInterface
- Direct Known Subclasses:
MySQLFullTextIndexFieldStrategy,PostgreSQLRDBMSActionStrategy,SQLiteRDBMSActionStrategy
Note that much of this class came from the old (old) QueryManager class.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.kingsrook.qqq.backend.module.rdbms.strategy.RDBMSActionStrategyInterface
RDBMSActionStrategyInterface.ResultSetProcessor -
Field Summary
Fields -
Constructor Summary
Constructors -
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 bindprotected voidbindParam(PreparedStatement statement, int index, byte[] value) protected voidbindParam(PreparedStatement statement, int index, Boolean value) protected voidbindParam(PreparedStatement statement, int index, Double value) protected voidbindParam(PreparedStatement statement, int index, Integer value) protected voidbindParam(PreparedStatement statement, int index, Long value) protected voidbindParam(PreparedStatement statement, int index, String value) protected voidbindParam(PreparedStatement statement, int index, BigDecimal value) protected voidbindParam(PreparedStatement statement, int index, Date value) protected voidbindParam(PreparedStatement statement, int index, Timestamp value) protected voidbindParam(PreparedStatement statement, int index, LocalDate value) protected voidbindParam(PreparedStatement statement, int index, LocalDateTime value) protected voidbindParam(PreparedStatement statement, int index, Calendar value) protected voidbindParamNull(PreparedStatement statement, int index) protected intbindParamObject(PreparedStatement statement, int index, Object value) index is 1-based!!protected voidbindParams(Object[] params, PreparedStatement statement) 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) protected StringgetColumnName(QFieldMetaData field) Get the column name to use for a field in the RDBMS, from the fieldMetaData.getFieldValueFromResultSet(QFieldType type, ResultSet resultSet, int i) getPageSize(AbstractActionInput actionInput) Getter for statisticsprotected voidincrementStatistic(String statName) Increment a statisticprotected PreparedStatementprepareStatementAndBindParams(Connection connection, String sql, Object[] params) voidclear the map of statisticsvoidsetCollectStatistics(boolean collectStatistics) Setter for collectStatisticsvoidsetPageSize(int pageSize) Setter for pageSizeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.kingsrook.qqq.backend.module.rdbms.strategy.RDBMSActionStrategyInterface
getIdentifierQuoteString
-
Field Details
-
DEFAULT_PAGE_SIZE
public static final int DEFAULT_PAGE_SIZE- See Also:
-
PAGE_SIZE
public static int PAGE_SIZE -
STAT_QUERIES_RAN
- See Also:
-
STAT_BATCHES_RAN
- See Also:
-
-
Constructor Details
-
BaseRDBMSActionStrategy
public BaseRDBMSActionStrategy()
-
-
Method Details
-
appendCriterionToWhereClause
public Integer appendCriterionToWhereClause(QFilterCriteria criterion, StringBuilder clause, String column, List<Serializable> values, QFieldMetaData field) Description copied from interface:RDBMSActionStrategyInterfacemodifies the clause StringBuilder (appending to it) returning the number of expected number of params to bind- Specified by:
appendCriterionToWhereClausein interfaceRDBMSActionStrategyInterface
-
getFieldValueFromResultSet
public Serializable getFieldValueFromResultSet(QFieldType type, ResultSet resultSet, int i) throws SQLException - Specified by:
getFieldValueFromResultSetin interfaceRDBMSActionStrategyInterface- Throws:
SQLException
-
executeUpdate
public PreparedStatement executeUpdate(Connection connection, String sql, List<Object> params) throws SQLException - Specified by:
executeUpdatein interfaceRDBMSActionStrategyInterface- Throws:
SQLException
-
executeBatchUpdate
public void executeBatchUpdate(Connection connection, String updateSQL, List<List<Serializable>> values) throws SQLException - Specified by:
executeBatchUpdatein interfaceRDBMSActionStrategyInterface- Throws:
SQLException
-
executeInsertForGeneratedIds
public List<Serializable> executeInsertForGeneratedIds(Connection connection, String sql, List<Object> params, QFieldMetaData primaryKeyField) throws SQLException - Specified by:
executeInsertForGeneratedIdsin interfaceRDBMSActionStrategyInterface- Throws:
SQLException
-
executeUpdateForRowCount
public Integer executeUpdateForRowCount(Connection connection, String sql, Object... params) throws SQLException - Specified by:
executeUpdateForRowCountin interfaceRDBMSActionStrategyInterface- Throws:
SQLException
-
executeStatement
public void executeStatement(PreparedStatement statement, CharSequence sql, RDBMSActionStrategyInterface.ResultSetProcessor processor, Object... params) throws SQLException, QException - Specified by:
executeStatementin interfaceRDBMSActionStrategyInterface- Throws:
SQLExceptionQException
-
getPageSize
- Specified by:
getPageSizein interfaceRDBMSActionStrategyInterface
-
prepareStatementAndBindParams
protected PreparedStatement prepareStatementAndBindParams(Connection connection, String sql, Object[] params) throws SQLException - Throws:
SQLException
-
bindParams
- Throws:
SQLException
-
bindParamObject
protected int bindParamObject(PreparedStatement statement, int index, Object value) throws SQLException index is 1-based!!- Throws:
SQLException
-
bindParam
- Throws:
SQLException
-
bindParam
- Throws:
SQLException
-
bindParam
- Throws:
SQLException
-
bindParam
- Throws:
SQLException
-
bindParam
- Throws:
SQLException
-
bindParam
- Throws:
SQLException
-
bindParam
protected void bindParam(PreparedStatement statement, int index, Timestamp value) throws SQLException - Throws:
SQLException
-
bindParam
protected void bindParam(PreparedStatement statement, int index, Calendar value) throws SQLException - Throws:
SQLException
-
bindParam
protected void bindParam(PreparedStatement statement, int index, LocalDate value) throws SQLException - Throws:
SQLException
-
bindParam
protected void bindParam(PreparedStatement statement, int index, LocalDateTime value) throws SQLException - Throws:
SQLException
-
bindParam
protected void bindParam(PreparedStatement statement, int index, BigDecimal value) throws SQLException - Throws:
SQLException
-
bindParam
- Throws:
SQLException
-
bindParamNull
- Throws:
SQLException
-
incrementStatistic
Increment a statistic -
setCollectStatistics
public void setCollectStatistics(boolean collectStatistics) Setter for collectStatistics -
resetStatistics
public void resetStatistics()clear the map of statistics -
getStatistics
-
setPageSize
public void setPageSize(int pageSize) Setter for pageSize -
getColumnName
Get the column name to use for a field in the RDBMS, from the fieldMetaData. That is, field.backendName if set -- else, field.name
-