Class SQLiteRDBMSActionStrategy
java.lang.Object
com.kingsrook.qqq.backend.module.rdbms.strategy.BaseRDBMSActionStrategy
com.kingsrook.qqq.backend.module.sqlite.strategy.SQLiteRDBMSActionStrategy
- All Implemented Interfaces:
RDBMSActionStrategyInterface
SQLite specialization of the default RDBMS/JDBC action strategy
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.kingsrook.qqq.backend.module.rdbms.strategy.RDBMSActionStrategyInterface
RDBMSActionStrategyInterface.ResultSetProcessor
-
Field Summary
Fields inherited from class com.kingsrook.qqq.backend.module.rdbms.strategy.BaseRDBMSActionStrategy
DEFAULT_PAGE_SIZE, PAGE_SIZE, STAT_BATCHES_RAN, STAT_QUERIES_RAN
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected int
bindParamObject
(PreparedStatement statement, int index, Object value) bind temporal types as strings (see above comment re: sqlite temporal types)executeInsertForGeneratedIds
(Connection connection, String sql, List<Object> params, QFieldMetaData primaryKeyField) per discussion (and rejected PR mentioned) on https://github.com/prrvchr/sqlite-jdbc sqlite jdbc by default will only return the latest generated serial.getFieldValueFromResultSet
(QFieldType type, ResultSet resultSet, int i) deal with sqlite not having temporal types... so temporal values i guess are stored as strings, as that's how they come back to us - so the JDBC methods fail trying to getDate or whatever from them - but getting the values as strings, they parse nicely, so do that.Methods inherited from class com.kingsrook.qqq.backend.module.rdbms.strategy.BaseRDBMSActionStrategy
appendCriterionToWhereClause, bindParam, bindParam, bindParam, bindParam, bindParam, bindParam, bindParam, bindParam, bindParam, bindParam, bindParam, bindParam, bindParamNull, bindParams, executeBatchUpdate, executeStatement, executeUpdate, executeUpdateForRowCount, getColumnName, getPageSize, getStatistics, incrementStatistic, prepareStatementAndBindParams, resetStatistics, setCollectStatistics, setPageSize
-
Constructor Details
-
SQLiteRDBMSActionStrategy
public SQLiteRDBMSActionStrategy()
-
-
Method Details
-
getFieldValueFromResultSet
public Serializable getFieldValueFromResultSet(QFieldType type, ResultSet resultSet, int i) throws SQLException deal with sqlite not having temporal types... so temporal values i guess are stored as strings, as that's how they come back to us - so the JDBC methods fail trying to getDate or whatever from them - but getting the values as strings, they parse nicely, so do that.- Specified by:
getFieldValueFromResultSet
in interfaceRDBMSActionStrategyInterface
- Overrides:
getFieldValueFromResultSet
in classBaseRDBMSActionStrategy
- Throws:
SQLException
-
bindParamObject
protected int bindParamObject(PreparedStatement statement, int index, Object value) throws SQLException bind temporal types as strings (see above comment re: sqlite temporal types)- Overrides:
bindParamObject
in classBaseRDBMSActionStrategy
- Throws:
SQLException
-
executeInsertForGeneratedIds
public List<Serializable> executeInsertForGeneratedIds(Connection connection, String sql, List<Object> params, QFieldMetaData primaryKeyField) throws SQLException per discussion (and rejected PR mentioned) on https://github.com/prrvchr/sqlite-jdbc sqlite jdbc by default will only return the latest generated serial. but we can get them all by appending this "RETURNING id" to the query, and then calling execute() (instead of executeUpdate()) and getResultSet (instead of getGeneratedKeys())- Specified by:
executeInsertForGeneratedIds
in interfaceRDBMSActionStrategyInterface
- Overrides:
executeInsertForGeneratedIds
in classBaseRDBMSActionStrategy
- Throws:
SQLException
-