org.infinispan.loaders.jdbc
Class TableManipulation
java.lang.Object
org.infinispan.loaders.jdbc.TableManipulation
- All Implemented Interfaces:
- Cloneable
public class TableManipulation
- extends Object
- implements Cloneable
Contains all the logic of manipulating the table, including creating it if needed and access operations like
inserting, selecting etc. Used by JDBC based cache loaders.
- Author:
- Mircea.Markus@jboss.com
DEFAULT_FETCH_SIZE
public static final int DEFAULT_FETCH_SIZE
- See Also:
- Constant Field Values
DEFAULT_BATCH_SIZE
public static final int DEFAULT_BATCH_SIZE
- See Also:
- Constant Field Values
databaseType
public DatabaseType databaseType
TableManipulation
public TableManipulation(String idColumnName,
String idColumnType,
String tableNamePrefix,
String dataColumnName,
String dataColumnType,
String timestampColumnName,
String timestampColumnType)
TableManipulation
public TableManipulation()
tableExists
public boolean tableExists(Connection connection,
String tableName)
throws CacheLoaderException
- Throws:
CacheLoaderException
createTable
public void createTable(Connection conn)
throws CacheLoaderException
- Throws:
CacheLoaderException
dropTable
public void dropTable(Connection conn)
throws CacheLoaderException
- Throws:
CacheLoaderException
setIdColumnName
public void setIdColumnName(String idColumnName)
setIdColumnType
public void setIdColumnType(String idColumnType)
setTableNamePrefix
public void setTableNamePrefix(String tableNamePrefix)
setDataColumnName
public void setDataColumnName(String dataColumnName)
setDataColumnType
public void setDataColumnType(String dataColumnType)
setTimestampColumnName
public void setTimestampColumnName(String timestampColumnName)
setTimestampColumnType
public void setTimestampColumnType(String timestampColumnType)
isCreateTableOnStart
public boolean isCreateTableOnStart()
setCreateTableOnStart
public void setCreateTableOnStart(boolean createTableOnStart)
isDropTableOnExit
public boolean isDropTableOnExit()
setDropTableOnExit
public void setDropTableOnExit(boolean dropTableOnExit)
start
public void start(ConnectionFactory connectionFactory)
throws CacheLoaderException
- Throws:
CacheLoaderException
stop
public void stop()
throws CacheLoaderException
- Throws:
CacheLoaderException
getInsertRowSql
public String getInsertRowSql()
getUpdateRowSql
public String getUpdateRowSql()
getSelectRowSql
public String getSelectRowSql()
getDeleteRowSql
public String getDeleteRowSql()
getLoadNonExpiredAllRowsSql
public String getLoadNonExpiredAllRowsSql()
getLoadAllRowsSql
public String getLoadAllRowsSql()
getDeleteAllRowsSql
public String getDeleteAllRowsSql()
getSelectExpiredRowsSql
public String getSelectExpiredRowsSql()
getDeleteExpiredRowsSql
public String getDeleteExpiredRowsSql()
clone
public TableManipulation clone()
- Overrides:
clone
in class Object
getTableName
public String getTableName()
getTableNamePrefix
public String getTableNamePrefix()
tableExists
public boolean tableExists(Connection connection)
throws CacheLoaderException
- Throws:
CacheLoaderException
getIdColumnName
public String getIdColumnName()
getIdColumnType
public String getIdColumnType()
getDataColumnName
public String getDataColumnName()
getDataColumnType
public String getDataColumnType()
getTimestampColumnName
public String getTimestampColumnName()
getTimestampColumnType
public String getTimestampColumnType()
getFetchSize
public int getFetchSize()
- For DB queries (e.g.
CacheStore.toStream(java.io.ObjectOutput)
) the fetch size
will be set on ResultSet.setFetchSize(int)
. This is optional parameter, if not specified will be
defaulted to DEFAULT_FETCH_SIZE
.
setFetchSize
public void setFetchSize(int fetchSize)
- See Also:
getFetchSize()
getBatchSize
public int getBatchSize()
- When doing repetitive DB inserts (e.g. on
CacheStore.fromStream(java.io.ObjectInput)
this will be batched according to this parameter. This is an optional parameter, and if it is not specified it
will be defaulted to DEFAULT_BATCH_SIZE
.
setBatchSize
public void setBatchSize(int batchSize)
- See Also:
getBatchSize()
setCacheName
public void setCacheName(String cacheName)
isVariableLimitSupported
public boolean isVariableLimitSupported()
getLoadSomeRowsSql
public String getLoadSomeRowsSql()
getLoadAllKeysBinarySql
public String getLoadAllKeysBinarySql()
getLoadAllKeysStringSql
public String getLoadAllKeysStringSql()
Copyright © 2011 JBoss, a division of Red Hat. All Rights Reserved.