public abstract class H2DatabaseType extends DatabaseType
| Modifier and Type | Field and Description |
|---|---|
static String |
VENDOR_NAME
The vendor name for all H2 databases.
|
| Constructor and Description |
|---|
H2DatabaseType() |
| Modifier and Type | Method and Description |
|---|---|
void |
alterColumn(Connection conn,
String table,
String column,
String generic_column_type,
String default_value,
String precision,
Boolean nullable,
Boolean reindex)
Alters an existing column.
|
String |
getHibernateDialect()
Return the hibernate dialect, that can be used in <property name="hibernate.dialect" value="" / >
expressions within persistence.xml
|
int |
getNextSequenceValue(Connection conn,
String table,
String key)
A utility that returns the next value of a sequence.
|
int |
getSequenceValue(Connection conn,
String table,
String key)
Assumes the sequence table is the value of the table argument followed by "_", the value of the key argument and
then "_seq".
|
String |
getVendor()
Returns
VENDOR_NAME. |
boolean |
isTableNotFoundException(SQLException e)
Determines if the given SQL exception was caused by a "table not found" error.
|
void |
reindexTable(Connection conn,
String table)
Reindexes the given table.
|
addColumn, checkColumnExists, checkTableExists, closeConnection, closeJDBCObjects, closeResultSet, closeStatement, countRows, createSequence, deleteColumn, dropSequence, dropTable, executeSelectSql, executeSql, executeSql, getBooleanValue, getDBTypeFromGenericType, getEscapeCharacter, getInteger, getLimitClause, getLong, getName, getSequenceInsertValue, getString, getVersion, insert, matches, setBooleanValue, supportsSelfReferringCascade, toString, update, updateColumnpublic static final String VENDOR_NAME
public String getVendor()
VENDOR_NAME.getVendor in class DatabaseTypeDatabaseType.getVendor()public String getHibernateDialect()
DatabaseTypegetHibernateDialect in class DatabaseTypepublic boolean isTableNotFoundException(SQLException e)
DatabaseTypeisTableNotFoundException in class DatabaseTypee - the SQL exception that occurredtrue if the given exception is the database's "table not found" exception.DatabaseType.isTableNotFoundException(SQLException)public int getSequenceValue(Connection conn, String table, String key) throws SQLException
getSequenceValue in class DatabaseTypeconn - The connection to use to get the sequence value.table - The table where the sequence is defined.key - The column on which the sequence is defined.SQLExceptionDatabaseType.getSequenceValue(Connection, String, String)public int getNextSequenceValue(Connection conn, String table, String key) throws SQLException
DatabaseTypegetNextSequenceValue in class DatabaseTypeconn - The connection to use to get the sequence value.table - The table where the sequence is defined.key - The column on which the sequence is defined.SQLExceptionDatabaseType.getNextSequenceValue(Connection, String, String)public void alterColumn(Connection conn, String table, String column, String generic_column_type, String default_value, String precision, Boolean nullable, Boolean reindex) throws SQLException
DatabaseTypealterColumn in class DatabaseTypeconn - connection to the databasetable - the name of the table where the column existscolumn - the name of the column to altergeneric_column_type - the new generic type of the columndefault_value - the new default valueprecision - the new precision of the columnnullable - the new nullable value (if true, it's value can now be NULL)reindex - if true, and the DB supports it, the table will be reindexedSQLExceptionDatabaseType.alterColumn(Connection, String, String, String, String, String, Boolean, Boolean)public void reindexTable(Connection conn, String table) throws SQLException
DatabaseTypereindexTable in class DatabaseTypeSQLExceptionDatabaseType.reindexTable(Connection, String)Copyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.