Class AbstractTableManager
- java.lang.Object
-
- org.infinispan.persistence.jdbc.table.management.AbstractTableManager
-
- All Implemented Interfaces:
TableManager
public abstract class AbstractTableManager extends Object implements TableManager
- Author:
- Ryan Emerson
-
-
Field Summary
Fields Modifier and Type Field Description protected String
cacheName
protected TableManipulationConfiguration
config
protected ConnectionFactory
connectionFactory
protected String
countRowsSql
protected String
deleteAllRows
protected String
deleteExpiredRowsSql
protected String
deleteRowSql
protected String
identifierQuoteString
protected String
insertRowSql
protected String
loadAllNonExpiredRowsSql
protected String
loadAllRowsSql
protected DbMetaData
metaData
protected String
selectExpiredRowsSql
protected String
selectIdRowSql
protected String
selectMultipleRowSql
protected String
selectRowSql
protected TableName
tableName
protected String
timestampIndexExt
protected String
updateRowSql
protected String
upsertRowSql
-
Fields inherited from interface org.infinispan.persistence.jdbc.table.management.TableManager
DEFAULT_BATCH_SIZE, DEFAULT_FETCH_SIZE
-
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.infinispan.persistence.jdbc.table.management.TableManager
prepareUpdateStatement
-
-
-
-
Field Detail
-
connectionFactory
protected final ConnectionFactory connectionFactory
-
config
protected final TableManipulationConfiguration config
-
timestampIndexExt
protected final String timestampIndexExt
- See Also:
- Constant Field Values
-
identifierQuoteString
protected String identifierQuoteString
-
cacheName
protected String cacheName
-
metaData
protected DbMetaData metaData
-
tableName
protected TableName tableName
-
insertRowSql
protected String insertRowSql
-
updateRowSql
protected String updateRowSql
-
upsertRowSql
protected String upsertRowSql
-
selectRowSql
protected String selectRowSql
-
selectMultipleRowSql
protected String selectMultipleRowSql
-
selectIdRowSql
protected String selectIdRowSql
-
deleteRowSql
protected String deleteRowSql
-
loadAllRowsSql
protected String loadAllRowsSql
-
countRowsSql
protected String countRowsSql
-
loadAllNonExpiredRowsSql
protected String loadAllNonExpiredRowsSql
-
deleteAllRows
protected String deleteAllRows
-
selectExpiredRowsSql
protected String selectExpiredRowsSql
-
deleteExpiredRowsSql
protected String deleteExpiredRowsSql
-
-
Method Detail
-
start
public void start() throws org.infinispan.persistence.spi.PersistenceException
- Specified by:
start
in interfaceTableManager
- Throws:
org.infinispan.persistence.spi.PersistenceException
-
stop
public void stop() throws org.infinispan.persistence.spi.PersistenceException
- Specified by:
stop
in interfaceTableManager
- Throws:
org.infinispan.persistence.spi.PersistenceException
-
setCacheName
public void setCacheName(String cacheName)
- Specified by:
setCacheName
in interfaceTableManager
-
tableExists
public boolean tableExists(Connection connection) throws org.infinispan.persistence.spi.PersistenceException
- Specified by:
tableExists
in interfaceTableManager
- Throws:
org.infinispan.persistence.spi.PersistenceException
-
tableExists
public boolean tableExists(Connection connection, TableName tableName) throws org.infinispan.persistence.spi.PersistenceException
- Specified by:
tableExists
in interfaceTableManager
- Throws:
org.infinispan.persistence.spi.PersistenceException
-
createTable
public void createTable(Connection conn) throws org.infinispan.persistence.spi.PersistenceException
- Specified by:
createTable
in interfaceTableManager
- Throws:
org.infinispan.persistence.spi.PersistenceException
-
createTimestampIndex
protected void createTimestampIndex(Connection conn) throws org.infinispan.persistence.spi.PersistenceException
- Throws:
org.infinispan.persistence.spi.PersistenceException
-
timestampIndexExists
protected boolean timestampIndexExists(Connection conn) throws org.infinispan.persistence.spi.PersistenceException
- Throws:
org.infinispan.persistence.spi.PersistenceException
-
executeUpdateSql
public void executeUpdateSql(Connection conn, String sql) throws org.infinispan.persistence.spi.PersistenceException
- Throws:
org.infinispan.persistence.spi.PersistenceException
-
dropTable
public void dropTable(Connection conn) throws org.infinispan.persistence.spi.PersistenceException
- Specified by:
dropTable
in interfaceTableManager
- Throws:
org.infinispan.persistence.spi.PersistenceException
-
dropTimestampIndex
protected void dropTimestampIndex(Connection conn) throws org.infinispan.persistence.spi.PersistenceException
- Throws:
org.infinispan.persistence.spi.PersistenceException
-
getDropTimestampSql
protected String getDropTimestampSql()
-
getFetchSize
public int getFetchSize()
- Specified by:
getFetchSize
in interfaceTableManager
-
getBatchSize
public int getBatchSize()
- Specified by:
getBatchSize
in interfaceTableManager
-
isUpsertSupported
public boolean isUpsertSupported()
- Specified by:
isUpsertSupported
in interfaceTableManager
-
getIdentifierQuoteString
public String getIdentifierQuoteString()
- Specified by:
getIdentifierQuoteString
in interfaceTableManager
-
getTableName
public TableName getTableName()
- Specified by:
getTableName
in interfaceTableManager
-
getIndexName
public String getIndexName(boolean withIdentifier)
-
getInsertRowSql
public String getInsertRowSql()
- Specified by:
getInsertRowSql
in interfaceTableManager
-
getUpdateRowSql
public String getUpdateRowSql()
- Specified by:
getUpdateRowSql
in interfaceTableManager
-
getSelectRowSql
public String getSelectRowSql()
- Specified by:
getSelectRowSql
in interfaceTableManager
-
getSelectMultipleRowSql
protected String getSelectMultipleRowSql(int numberOfParams, String selectCriteria)
-
getSelectMultipleRowSql
public String getSelectMultipleRowSql(int numberOfParams)
- Specified by:
getSelectMultipleRowSql
in interfaceTableManager
-
getSelectIdRowSql
public String getSelectIdRowSql()
- Specified by:
getSelectIdRowSql
in interfaceTableManager
-
getCountRowsSql
public String getCountRowsSql()
- Specified by:
getCountRowsSql
in interfaceTableManager
-
getDeleteRowSql
public String getDeleteRowSql()
- Specified by:
getDeleteRowSql
in interfaceTableManager
-
getLoadNonExpiredAllRowsSql
public String getLoadNonExpiredAllRowsSql()
- Specified by:
getLoadNonExpiredAllRowsSql
in interfaceTableManager
-
getLoadAllRowsSql
public String getLoadAllRowsSql()
- Specified by:
getLoadAllRowsSql
in interfaceTableManager
-
getDeleteAllRowsSql
public String getDeleteAllRowsSql()
- Specified by:
getDeleteAllRowsSql
in interfaceTableManager
-
getSelectExpiredBucketsSql
public String getSelectExpiredBucketsSql()
- Specified by:
getSelectExpiredBucketsSql
in interfaceTableManager
-
getSelectOnlyExpiredRowsSql
public String getSelectOnlyExpiredRowsSql()
- Specified by:
getSelectOnlyExpiredRowsSql
in interfaceTableManager
-
getUpsertRowSql
public String getUpsertRowSql()
- Specified by:
getUpsertRowSql
in interfaceTableManager
-
isStringEncodingRequired
public boolean isStringEncodingRequired()
- Specified by:
isStringEncodingRequired
in interfaceTableManager
-
encodeString
public String encodeString(String string)
- Specified by:
encodeString
in interfaceTableManager
-
prepareUpsertStatement
public void prepareUpsertStatement(PreparedStatement ps, String key, long timestamp, org.infinispan.commons.io.ByteBuffer byteBuffer) throws SQLException
- Specified by:
prepareUpsertStatement
in interfaceTableManager
- Throws:
SQLException
-
-