| net.sourceforge.squirrel_sql.fw.dialects.HibernateDialect
All known Subclasses: net.sourceforge.squirrel_sql.fw.dialects.IngresDialect, net.sourceforge.squirrel_sql.fw.dialects.MySQLDialect, net.sourceforge.squirrel_sql.fw.dialects.MAXDBDialect, net.sourceforge.squirrel_sql.fw.dialects.TimesTenDialect, net.sourceforge.squirrel_sql.fw.dialects.PostgreSQLDialect, net.sourceforge.squirrel_sql.fw.dialects.InterbaseDialect, net.sourceforge.squirrel_sql.fw.dialects.SQLServerDialect, net.sourceforge.squirrel_sql.fw.dialects.AxionDialect, net.sourceforge.squirrel_sql.fw.dialects.DaffodilDialect, net.sourceforge.squirrel_sql.fw.dialects.InformixDialect, net.sourceforge.squirrel_sql.fw.dialects.HADBDialect, net.sourceforge.squirrel_sql.fw.dialects.SybaseDialect, net.sourceforge.squirrel_sql.fw.dialects.McKoiDialect, net.sourceforge.squirrel_sql.fw.dialects.PointbaseDialect, net.sourceforge.squirrel_sql.fw.dialects.FirebirdDialect, net.sourceforge.squirrel_sql.fw.dialects.ProgressDialect, net.sourceforge.squirrel_sql.fw.dialects.DB2Dialect, net.sourceforge.squirrel_sql.fw.dialects.HSQLDialect, net.sourceforge.squirrel_sql.fw.dialects.H2Dialect, net.sourceforge.squirrel_sql.fw.dialects.Oracle9iDialect, net.sourceforge.squirrel_sql.fw.dialects.DerbyDialect, net.sourceforge.squirrel_sql.fw.dialects.FrontBaseDialect,
HibernateDialect | public interface HibernateDialect (Code) | | An interface for methods implemented by database dialects for the purpose of
handling standard and non-standard SQL and database types.
|
Method Summary | |
boolean | canPasteTo(IDatabaseObjectInfo info) Returns a boolean indicating whether or not the specified database object
can be pasted into for this database dialect. | String | getAddColumnString() Returns the SQL fragment for adding a column in an alter table statment. | String[] | getAddPrimaryKeySQL(String pkName, TableColumnInfo[] colInfos, ITableInfo ti) Returns the SQL that forms the command to add a primary key to the
specified table composed of the given column names. | String[] | getColumnAddSQL(TableColumnInfo info) Returns the SQL statement to use to add a column to the specified table
using the information about the new column specified by info. | public String | getColumnCommentAlterSQL(TableColumnInfo info) Returns the SQL statement to use to add a comment to the specified
column of the specified table. | String | getColumnDefaultAlterSQL(TableColumnInfo info) Returns the SQL command to change the specified column's default value
Parameters: info - the column to modify and it's default value. | String | getColumnDropSQL(String tableName, String columnName) Returns the SQL that forms the command to drop the specified colum in the
specified table. | int | getColumnLength(int columnSize, int dataType) Some jdbc drivers are hopelessly broken with regard to reporting the
COLUMN_SIZE. | String | getColumnNameAlterSQL(TableColumnInfo from, TableColumnInfo to) Returns the SQL that is used to change the column name. | String | getColumnNullableAlterSQL(TableColumnInfo info) | List<String> | getColumnTypeAlterSQL(TableColumnInfo from, TableColumnInfo to) Returns the SQL that is used to change the column type. | List<String> | getCreateTableSQL(List<ITableInfo> tables, ISQLDatabaseMetaData md, CreateScriptPreferences prefs, boolean isJdbcOdbc) Returns the SQL command to create the specified table.
Parameters: tables - the tables to get create statements for Parameters: md - the metadata from the ISession Parameters: prefs - preferences about how the resultant SQL commands should be formed. Parameters: isJdbcOdbc - whether or not the connection is via JDBC-ODBC bridge. | String | getDisplayName() The string which identifies this dialect in the dialect chooser. | String | getDropForeignKeySQL(String fkName, String tableName) Returns the SQL command to drop the specified table's foreign key
constraint. | String | getDropPrimaryKeySQL(String pkName, String tableName) Returns the SQL command to drop the specified table's primary key. | String | getLengthFunction(int dataType) Returns the name of the function that measures the length of a character
string.
Parameters: dataType - the java.sql.Types data type. | String | getMaxFunction() Returns the name of the aggregate function that determines the max value
of an expression. | int | getMaxPrecision(int dataType) Returns the maximum precision allowed by the database for number type
fields that specify the length of the number to the left of the decimal
point in digits. | int | getMaxScale(int dataType) Returns the maximum scale allowed by the database for number type
fields that specify the length of the number to the right of the decimal
point in digits. | String | getNullColumnString() Returns the string that should be appended to a column declaration when
nulls are allowed in the column. | int | getPrecisionDigits(int columnSize, int dataType) Returns the number of digits of precision is represented by the specifed
columnSize for the specified dataType. | List<String> | getTableDropSQL(ITableInfo iTableInfo, boolean cascadeConstraints, boolean isMaterializedView) Returns the SQL that forms the command to drop the specified table. | String | getTypeName(int code, int length, int precision, int scale) Get the name of the database type associated with the given
java.sql.Types typecode. | boolean | supportsAlterColumnDefault() Returns a boolean value indicating whether or not this database dialect
supports changing a column's default value. | boolean | supportsAlterColumnNull() Returns a boolean value indicating whether or not this database dialect
supports changing a column from null to not-null and vice versa. | boolean | supportsAlterColumnType() Returns a boolean value indicating whether or not this dialect supports
modifying a columns type. | boolean | supportsColumnComment() Returns a boolean value indicating whether or not this dialect supports
adding comments to columns. | boolean | supportsDropColumn() Returns a boolean value indicating whether or not this database dialect
supports dropping columns from tables. | boolean | supportsProduct(String databaseProductName, String databaseProductVersion) Returns boolean value indicating whether or not this dialect supports the
specified database product/version. | boolean | supportsRenameColumn() Returns a boolean value indicating whether or not this database dialect
supports renaming columns. | boolean | supportsSchemasInTableDefinition() Returns a boolean value indicating whether or not this database dialect
supports table creation statements where the table name is prefixed by
the schema. |
canPasteTo | boolean canPasteTo(IDatabaseObjectInfo info)(Code) | | Returns a boolean indicating whether or not the specified database object
can be pasted into for this database dialect. Some databases support the
notion of schemas where tables live, and in those cases pasting to a
database object in the object tree is not really appropriate. However,
other databases don't support schemas (like Axion, Firebird)
Parameters: info - |
getAddColumnString | String getAddColumnString()(Code) | | Returns the SQL fragment for adding a column in an alter table statment.
|
getAddPrimaryKeySQL | String[] getAddPrimaryKeySQL(String pkName, TableColumnInfo[] colInfos, ITableInfo ti)(Code) | | Returns the SQL that forms the command to add a primary key to the
specified table composed of the given column names.
Parameters: pkName - the name of the constraint Parameters: ti - TODO Parameters: columnNames - the columns that form the key |
getColumnAddSQL | String[] getColumnAddSQL(TableColumnInfo info) throws HibernateException, UnsupportedOperationException(Code) | | Returns the SQL statement to use to add a column to the specified table
using the information about the new column specified by info.
Parameters: info - information about the new column such as type, name, etc. throws: UnsupportedOperationException - if the database doesn't support adding columns after a table has already been created. throws: HibernateException - if the type in the specified info isn't supported by this dialect. |
getColumnDefaultAlterSQL | String getColumnDefaultAlterSQL(TableColumnInfo info)(Code) | | Returns the SQL command to change the specified column's default value
Parameters: info - the column to modify and it's default value. SQL to make the change |
getColumnDropSQL | String getColumnDropSQL(String tableName, String columnName) throws UnsupportedOperationException(Code) | | Returns the SQL that forms the command to drop the specified colum in the
specified table.
Parameters: tableName - the name of the table that has the column Parameters: columnName - the name of the column to drop. |
getColumnLength | int getColumnLength(int columnSize, int dataType)(Code) | | Some jdbc drivers are hopelessly broken with regard to reporting the
COLUMN_SIZE. For example, MaxDB has a "long byte" data type which can
store up to 2G of data, yet the driver reports that the column size is
"8" - real helpful. So for drivers that have this problem, return the
"proper" maximum column length for the specified dataType. If the driver
doesn't have this problem, just return the columnSize.
Parameters: columnSize - the size of the column as reported by the jdbc driver Parameters: dataType - the type of the column. the specified columnSize if the jdbc driver isn't broken; otherwise, the maximum column size for the specified dataType ifthe driver is broken. |
getColumnNameAlterSQL | String getColumnNameAlterSQL(TableColumnInfo from, TableColumnInfo to)(Code) | | Returns the SQL that is used to change the column name.
Parameters: from - the TableColumnInfo as it is Parameters: to - the TableColumnInfo as it wants to be the SQL to make the change |
getColumnNullableAlterSQL | String getColumnNullableAlterSQL(TableColumnInfo info)(Code) | | Returns the SQL used to alter the nullability of the specified column
Parameters: info - the column to modify the SQL to execute |
getCreateTableSQL | List<String> getCreateTableSQL(List<ITableInfo> tables, ISQLDatabaseMetaData md, CreateScriptPreferences prefs, boolean isJdbcOdbc) throws SQLException(Code) | | Returns the SQL command to create the specified table.
Parameters: tables - the tables to get create statements for Parameters: md - the metadata from the ISession Parameters: prefs - preferences about how the resultant SQL commands should be formed. Parameters: isJdbcOdbc - whether or not the connection is via JDBC-ODBC bridge. the SQL that is used to create the specified table |
getDisplayName | String getDisplayName()(Code) | | The string which identifies this dialect in the dialect chooser.
a descriptive name that tells the user what database this dialectis design to work with. |
getDropForeignKeySQL | String getDropForeignKeySQL(String fkName, String tableName)(Code) | | Returns the SQL command to drop the specified table's foreign key
constraint.
Parameters: fkName - the name of the foreign key that should be dropped Parameters: tableName - the name of the table whose foreign key should be dropped |
getDropPrimaryKeySQL | String getDropPrimaryKeySQL(String pkName, String tableName)(Code) | | Returns the SQL command to drop the specified table's primary key.
Parameters: pkName - the name of the primary key that should be dropped Parameters: tableName - the name of the table whose primary key should be dropped |
getLengthFunction | String getLengthFunction(int dataType)(Code) | | Returns the name of the function that measures the length of a character
string.
Parameters: dataType - the java.sql.Types data type. Some databases have different length functions for different data types. the name of the function to be applied to a column to determinethe length of that column in a particular record. |
getMaxFunction | String getMaxFunction()(Code) | | Returns the name of the aggregate function that determines the max value
of an expression.
the name of the function to be applied to a set to determine the element with the highest numeric value. |
getMaxPrecision | int getMaxPrecision(int dataType)(Code) | | Returns the maximum precision allowed by the database for number type
fields that specify the length of the number to the left of the decimal
point in digits. If the HibernateDialect implementation doesn't ever
use $p in any call to registerColumnType(), then this maximum precsision
will not be used.
Parameters: dataType - the java.sql.Types data type. the maximum number that can be used in a column declaration for precision for the specified type. |
getMaxScale | int getMaxScale(int dataType)(Code) | | Returns the maximum scale allowed by the database for number type
fields that specify the length of the number to the right of the decimal
point in digits. If the HibernateDialect implementation doesn't ever
use $s in any call to registerColumnType(), then this maximum scale
will not be used.
Parameters: dataType - the java.sql.Types data type. the maximum number that can be used in a column declaration for scale for the specified type. |
getNullColumnString | String getNullColumnString()(Code) | | Returns the string that should be appended to a column declaration when
nulls are allowed in the column.
the "nulls are allowed in this column" string for a table declaration |
getPrecisionDigits | int getPrecisionDigits(int columnSize, int dataType)(Code) | | Returns the number of digits of precision is represented by the specifed
columnSize for the specified dataType. Some DBs represent precision as
the total number of digits on the right or left of the decimal. That is
what we want. Others (like PostgreSQL) give the number of bytes of
storage a column can use - less than useful, since the SQL-92 says
"number of digits" and this is what most other DBs use.
Parameters: columnSize - the size of the column as reported by the driver. Parameters: dataType - the java.sql.Types data type. a number indicating the total number of digits (includes bothsides of the decimal point) the column can represent. |
getTableDropSQL | List<String> getTableDropSQL(ITableInfo iTableInfo, boolean cascadeConstraints, boolean isMaterializedView)(Code) | | Returns the SQL that forms the command to drop the specified table. If
cascade contraints is supported by the dialect and cascadeConstraints is
true, then a drop statement with cascade constraints clause will be
formed.
Parameters: iTableInfo - the table to drop Parameters: cascadeConstraints - whether or not to drop any FKs that may reference the specified table. Parameters: isMaterializedView - TODO the drop SQL command. |
getTypeName | String getTypeName(int code, int length, int precision, int scale) throws HibernateException(Code) | | Get the name of the database type associated with the given
java.sql.Types typecode.
Parameters: code - java.sql.Types typecode Parameters: length - the length or precision of the column Parameters: precision - the precision of the column Parameters: scale - the scale of the column the database type name throws: HibernateException - |
supportsAlterColumnDefault | boolean supportsAlterColumnDefault()(Code) | | Returns a boolean value indicating whether or not this database dialect
supports changing a column's default value.
true if the database supports modifying column defaults; false otherwise |
supportsAlterColumnNull | boolean supportsAlterColumnNull()(Code) | | Returns a boolean value indicating whether or not this database dialect
supports changing a column from null to not-null and vice versa.
true if the database supports dropping columns; false otherwise. |
supportsAlterColumnType | boolean supportsAlterColumnType()(Code) | | Returns a boolean value indicating whether or not this dialect supports
modifying a columns type.
true if supported; false otherwise |
supportsColumnComment | boolean supportsColumnComment()(Code) | | Returns a boolean value indicating whether or not this dialect supports
adding comments to columns.
true if column comments are supported; false otherwise. |
supportsDropColumn | boolean supportsDropColumn()(Code) | | Returns a boolean value indicating whether or not this database dialect
supports dropping columns from tables.
true if the database supports dropping columns; false otherwise. |
supportsProduct | boolean supportsProduct(String databaseProductName, String databaseProductVersion)(Code) | | Returns boolean value indicating whether or not this dialect supports the
specified database product/version.
Parameters: databaseProductName - the name of the database as reported by DatabaseMetaData.getDatabaseProductName() Parameters: databaseProductVersion - the version of the database as reported byDatabaseMetaData.getDatabaseProductVersion() true if this dialect can be used for the specified product nameand version; false otherwise. |
supportsRenameColumn | boolean supportsRenameColumn()(Code) | | Returns a boolean value indicating whether or not this database dialect
supports renaming columns.
true if the database supports changing the name of columns; false otherwise. |
supportsSchemasInTableDefinition | boolean supportsSchemasInTableDefinition()(Code) | | Returns a boolean value indicating whether or not this database dialect
supports table creation statements where the table name is prefixed by
the schema.
|
|
|