Revision: 6263
http://squirrel-sql.svn.sourceforge.net/squirrel-sql/?rev=6263&view=rev
Author: manningr
Date: 2011-05-17 01:11:28 +0000 (Tue, 17 May 2011)
Log Message:
-----------
Added support in the dialects for converting a byte array value (from a binary type column) to a n ascii hex string which can be used in SQL statements.
Modified Paths:
--------------
trunk/sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/dialects/CommonHibernateDialect.java
trunk/sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/dialects/DB2DialectExt.java
trunk/sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/dialects/DialectUtils.java
trunk/sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/dialects/HibernateDialect.java
trunk/sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/dialects/MySQLDialectExt.java
trunk/sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/dialects/SybaseDialectExt.java
Modified: trunk/sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/dialects/CommonHibernateDialect.java
===================================================================
--- trunk/sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/dialects/CommonHibernateDialect.java 2011-05-16 18:22:36 UTC (rev 6262)
+++ trunk/sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/dialects/CommonHibernateDialect.java 2011-05-17 01:11:28 UTC (rev 6263)
@@ -995,4 +995,11 @@
return 3;
}
+ @Override
+ public String getBinaryLiteralString(byte[] binaryData) {
+ StringBuilder result = new StringBuilder();
+ result.append("'").append(DialectUtils.toHexString(binaryData)).append("'");
+ return result.toString();
+ }
+
}
Modified: trunk/sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/dialects/DB2DialectExt.java
===================================================================
--- trunk/sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/dialects/DB2DialectExt.java 2011-05-16 18:22:36 UTC (rev 6262)
+++ trunk/sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/dialects/DB2DialectExt.java 2011-05-17 01:11:28 UTC (rev 6263)
@@ -1259,4 +1259,14 @@
return 6;
}
+ /**
+ * @see net.sourceforge.squirrel_sql.fw.dialects.CommonHibernateDialect#getBinaryLiteralString(byte[])
+ */
+ @Override
+ public String getBinaryLiteralString(byte[] binaryData)
+ {
+ return "BLOB(x'" + DialectUtils.toHexString(binaryData) + "')";
+ }
+
+
}
Modified: trunk/sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/dialects/DialectUtils.java
===================================================================
--- trunk/sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/dialects/DialectUtils.java 2011-05-16 18:22:36 UTC (rev 6262)
+++ trunk/sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/dialects/DialectUtils.java 2011-05-17 01:11:28 UTC (rev 6263)
@@ -725,9 +725,11 @@
final ArrayList<String> result = new ArrayList<String>();
// ALTER TABLE localTableName
- // ADD CONSTRAINT constraintName FOREIGN KEY (localColumn1, localColumn2)
+ // ADD CONSTRAINT constraintName FOREIGN KEY (localColumn1,
+ // localColumn2)
// REFERENCES referencedTableName (referencedColumn1, referencedColumn2)
- // MATCH FULL ON UPDATE RESTRICT ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED;
+ // MATCH FULL ON UPDATE RESTRICT ON DELETE NO ACTION DEFERRABLE
+ // INITIALLY DEFERRED;
final StringBuilder sql = new StringBuilder();
sql.append(DialectUtils.ALTER_TABLE_CLAUSE + " ");
@@ -1060,12 +1062,9 @@
}
/**
- * Returns the SQL that is used to change the column type. For example:
- * <code>
+ * Returns the SQL that is used to change the column type. For example: <code>
* ALTER TABLE table_name alter_clause column_name [setClause] data_type
- * </code>
- * or
- * <code>
+ * </code> or <code>
* ALTER TABLE table_name alter_clause column_name column_name [setClause] data_type
* </code>
*
@@ -1117,8 +1116,7 @@
}
/**
- * Returns the SQL that is used to change the column name. For example:
- * <code>
+ * Returns the SQL that is used to change the column name. For example: <code>
* RENAME COLUMN table_name.column_name TO new_column_name
* </code>
*
@@ -1174,38 +1172,46 @@
switch (featureId)
{
case COLUMN_COMMENT_ALTER_TYPE:
- // i18n[DialectUtils.columnCommentUnsupported={0} doesn''t support column comments]
+ // i18n[DialectUtils.columnCommentUnsupported={0} doesn''t support
+ // column comments]
msg = s_stringMgr.getString("DialectUtils.columnCommentUnsupported", dialect.getDisplayName());
break;
case COLUMN_DEFAULT_ALTER_TYPE:
- // i18n[DialectUtils.columnDefaultUnsupported={0} doesn''t support altering a column''s default
+ // i18n[DialectUtils.columnDefaultUnsupported={0} doesn''t support
+ // altering a column''s default
// value]
msg = s_stringMgr.getString("DialectUtils.columnDefaultUnsupported", dialect.getDisplayName());
break;
case COLUMN_DROP_TYPE:
- // i18n[DialectUtils.columnDropUnsupported={0} doesn''t support dropping a column]
+ // i18n[DialectUtils.columnDropUnsupported={0} doesn''t support
+ // dropping a column]
msg = s_stringMgr.getString("DialectUtils.columnDropUnsupported", dialect.getDisplayName());
break;
case COLUMN_NAME_ALTER_TYPE:
- // i18n[DialectUtils.columnNameUnsupported={0} doesn''t support altering a column''s name]
+ // i18n[DialectUtils.columnNameUnsupported={0} doesn''t support
+ // altering a column''s name]
msg = s_stringMgr.getString("DialectUtils.columnNameUnsupported", dialect.getDisplayName());
break;
case COLUMN_NULL_ALTER_TYPE:
- // i18n[DialectUtils.columnNullUnsupported={0} doesn''t support altering a column's nullable
+ // i18n[DialectUtils.columnNullUnsupported={0} doesn''t support
+ // altering a column's nullable
// attribute]
msg = s_stringMgr.getString("DialectUtils.columnNullUnsupported", dialect.getDisplayName());
break;
case COLUMN_TYPE_ALTER_TYPE:
- // i18n[DialectUtils.columnTypeUnsupported={0} doesn''t support altering a column's type attribute]
+ // i18n[DialectUtils.columnTypeUnsupported={0} doesn''t support
+ // altering a column's type attribute]
msg = s_stringMgr.getString("DialectUtils.columnTypeUnsupported", dialect.getDisplayName());
break;
case ADD_PRIMARY_KEY_TYPE:
- // i18n[DialectUtils.addPrimaryKeyUnsupported={0} doesn''t support adding primary keys]
+ // i18n[DialectUtils.addPrimaryKeyUnsupported={0} doesn''t support
+ // adding primary keys]
msg = s_stringMgr.getString("DialectUtils.addPrimaryKeyUnsupported", dialect.getDisplayName());
break;
case DROP_PRIMARY_KEY_TYPE:
- // i18n[DialectUtils.dropPrimaryKeyUnsupported={0} doesn''t support dropping primary keys]
+ // i18n[DialectUtils.dropPrimaryKeyUnsupported={0} doesn''t support
+ // dropping primary keys]
msg = s_stringMgr.getString("DialectUtils.dropPrimaryKeyUnsupported", dialect.getDisplayName());
break;
case CREATE_TABLE_TYPE:
@@ -1254,12 +1260,9 @@
}
/**
- * Returns the SQL command to drop the specified table's primary key. For example:
- * <code>
+ * Returns the SQL command to drop the specified table's primary key. For example: <code>
* alter table table_name drop primary key
- * </code>
- * or
- * <code>
+ * </code> or <code>
* alter table table_name drop constraint [pkName]
* </code>
*
@@ -1527,7 +1530,8 @@
String accessMethod, String[] columns, boolean unique, String tablespace, String constraints,
DatabaseObjectQualifier qualifier, SqlGenerationPreferences prefs)
{
- // CREATE UNIQUE INDEX indexName ON tableName USING btree (column1, column2) TABLESPACE
+ // CREATE UNIQUE INDEX indexName ON tableName USING btree (column1,
+ // column2) TABLESPACE
// WHERE constraints;
final StringBuilder sql = new StringBuilder();
@@ -1765,9 +1769,9 @@
if (primaryKeys != null && primaryKeys.size() > 1)
{
- sql.append(" " + DialectUtils.CONSTRAINT_CLAUSE + " ").append(
- shapeIdentifier(simpleName + "_pkey", prefs, dialect)).append(
- " " + DialectUtils.PRIMARY_KEY_CLAUSE + "(");
+ sql.append(" " + DialectUtils.CONSTRAINT_CLAUSE + " ")
+ .append(shapeIdentifier(simpleName + "_pkey", prefs, dialect))
+ .append(" " + DialectUtils.PRIMARY_KEY_CLAUSE + "(");
for (final TableColumnInfo pkPart : primaryKeys)
{
sql.append(shapeIdentifier(pkPart.getColumnName(), prefs, dialect)).append(",");
@@ -1790,7 +1794,7 @@
{
return getCreateTableSQL(tables, md, dialect, prefs, isJdbcOdbc, false);
}
-
+
public static List<String> getCreateTableSQL(List<ITableInfo> tables, ISQLDatabaseMetaData md,
HibernateDialect dialect, CreateScriptPreferences prefs, boolean isJdbcOdbc, boolean sortColumns)
throws SQLException
@@ -1808,7 +1812,8 @@
final List<PrimaryKeyInfo> pkInfos = getPrimaryKeyInfo(md, ti, isJdbcOdbc);
final List<String> pks = getPKSequenceList(pkInfos);
final TableColumnInfo[] infos = md.getColumnInfo(ti);
- if (sortColumns) {
+ if (sortColumns)
+ {
Arrays.sort(infos);
}
for (final TableColumnInfo tcInfo : infos)
@@ -1828,7 +1833,8 @@
}
else
{
- // in Sybase, DEFAULT keyword must appear prior to NULL/NOT NULL
+ // in Sybase, DEFAULT keyword must appear prior to NULL/NOT
+ // NULL
if (defaultVal != null && !"".equals(defaultVal))
{
result.append(" DEFAULT ");
@@ -1955,8 +1961,9 @@
// AS definition;
final StringBuilder sql = new StringBuilder();
- sql.append(DialectUtils.CREATE_VIEW_CLAUSE + " ").append(
- shapeQualifiableIdentifier(viewName, qualifier, prefs, dialect)).append("\n");
+ sql.append(DialectUtils.CREATE_VIEW_CLAUSE + " ")
+ .append(shapeQualifiableIdentifier(viewName, qualifier, prefs, dialect))
+ .append("\n");
sql.append(" AS ").append(definition);
if (dialect.supportsCheckOptionsForViews() && checkOption != null && !checkOption.equals(""))
{
@@ -2243,7 +2250,8 @@
{
final ArrayList<String> result = new ArrayList<String>();
- // Since dialect doesn't support altering sequences, drop then re-create.
+ // Since dialect doesn't support altering sequences, drop then
+ // re-create.
result.add(dialect.getDropSequenceSQL(sequenceName, false, qualifier, prefs));
result.add(dialect.getCreateSequenceSQL(sequenceName, increment, minimum, maximum, minimum, cache,
cycle, qualifier, prefs));
@@ -2252,9 +2260,11 @@
}
/**
- * Gets the SQL command to insert data into a table. <p/> If the list of columns is empty or null the SQL
- * will look like: INSERT INTO tablename query; <p/> instead of: INSERT INTO tablename ( column1, column2,
- * ... ) query;
+ * Gets the SQL command to insert data into a table.
+ * <p/>
+ * If the list of columns is empty or null the SQL will look like: INSERT INTO tablename query;
+ * <p/>
+ * instead of: INSERT INTO tablename ( column1, column2, ... ) query;
*
* @param tableName
* simple name of the table
@@ -2341,10 +2351,14 @@
if (fromTables == null && setValues == null) { throw new IllegalArgumentException(
"One of fromTables or setValues args must be non-null"); }
- // Since we can use a correlated sub-query to update all rows in one statement, we don't care about the
- // set values, unless fromTables is null, in which case we go with a normal update. Using the set
- // values would require an update statement for each row in the merged table for each column that was
- // merged in, which is incredibly inefficient. However, the API is intended to support database
+ // Since we can use a correlated sub-query to update all rows in one
+ // statement, we don't care about the
+ // set values, unless fromTables is null, in which case we go with a
+ // normal update. Using the set
+ // values would require an update statement for each row in the merged
+ // table for each column that was
+ // merged in, which is incredibly inefficient. However, the API is
+ // intended to support database
// dialects that can't handle correlated sub-queries.
final ArrayList<String> result = new ArrayList<String>();
@@ -2368,7 +2382,7 @@
// // update <destTableName> dest
// // set <setColumnName> = <setValue>
// // where f.<whereColumn> = s.<whereValue>)
- //
+ //
// templateStr =
// "UPDATE $destTableName$ " +
// "SET $columnName$ = $columnValue$ " +
@@ -2425,10 +2439,10 @@
* @param primaryKeys
* can be null
* @param prefs
- * @return
+ * @return
*/
public static List<String> createIndexes(ITableInfo ti, ISQLDatabaseMetaData md,
- List<PrimaryKeyInfo> primaryKeys, CreateScriptPreferences prefs)
+ List<PrimaryKeyInfo> primaryKeys, CreateScriptPreferences prefs)
{
if (ti == null) { throw new IllegalArgumentException("ti cannot be null"); }
if (md == null) { throw new IllegalArgumentException("md cannot be null"); }
@@ -2452,7 +2466,8 @@
}
catch (final SQLException e)
{
- // i18n[DialectUtils.error.getprimarykey=Unable to get primary key info for table {0}]
+ // i18n[DialectUtils.error.getprimarykey=Unable to get primary key
+ // info for table {0}]
final String msg = s_stringMgr.getString("DialectUtils.error.getprimarykey", ti.getSimpleName());
log.error(msg, e);
return result;
@@ -2478,8 +2493,8 @@
final List<IndexColInfo> ixCols = new ArrayList<IndexColInfo>();
ixCols.add(new IndexColInfo(columnName, indexInfo.getOrdinalPosition()));
- buf.put(indexName, new TableIndexInfo(indexInfo.getTableName(), indexInfo.getSchemaName(), indexName, ixCols,
- !indexInfo.isNonUnique()));
+ buf.put(indexName, new TableIndexInfo(indexInfo.getTableName(), indexInfo.getSchemaName(),
+ indexName, ixCols, !indexInfo.isNonUnique()));
}
else
{
@@ -2494,9 +2509,12 @@
if (pkCols.equals(ix.cols))
{
- // Serveral DBs automatically create an index for primary key fields
- // and return this index in getIndexInfo(). We remove this index from the script
- // because it would break the script with an index already exists error.
+ // Serveral DBs automatically create an index for primary key
+ // fields
+ // and return this index in getIndexInfo(). We remove this index
+ // from the script
+ // because it would break the script with an index already
+ // exists error.
continue;
}
@@ -2509,9 +2527,9 @@
indexSQL.append(ix.ixName);
indexSQL.append(" ON ");
- indexSQL.append(formatQualifIntern(ix.table, ix.tableSchema, prefs));
+ indexSQL.append(formatQualifIntern(ix.table, ix.tableSchema, prefs));
- if (ix.cols.size() == 1)
+ if (ix.cols.size() == 1)
{
indexSQL.append("(").append(ix.cols.get(0));
@@ -2571,10 +2589,10 @@
}
}
- sbToAppend.append("ALTER TABLE " + formatQualifIntern(ci.fkTable, ci.fkTableSchema, prefs) + "\n");
- sbToAppend.append("ADD CONSTRAINT " + ci.fkName + "\n");
+ sbToAppend.append("ALTER TABLE " + formatQualifIntern(ci.fkTable, ci.fkTableSchema, prefs) + "\n");
+ sbToAppend.append("ADD CONSTRAINT " + ci.fkName + "\n");
- if (ci.fkCols.size() == 1)
+ if (ci.fkCols.size() == 1)
{
sbToAppend.append("FOREIGN KEY (").append(ci.fkCols.get(0));
@@ -2584,8 +2602,8 @@
}
sbToAppend.append(")\n");
- sbToAppend.append("REFERENCES " + formatQualifIntern(ci.pkTable, ci.pkTableSchema, prefs) + "(");
- sbToAppend.append(ci.pkCols.get(0));
+ sbToAppend.append("REFERENCES " + formatQualifIntern(ci.pkTable, ci.pkTableSchema, prefs) + "(");
+ sbToAppend.append(ci.pkCols.get(0));
for (int j = 1; j < ci.pkCols.size(); j++)
{
sbToAppend.append(",").append(ci.pkCols.get(j));
@@ -2609,8 +2627,8 @@
sbToAppend.append(")\n");
sbToAppend.append("REFERENCES ");
- sbToAppend.append(formatQualifIntern(ci.pkTable, ci.pkTableSchema, prefs));
- sbToAppend.append("\n");
+ sbToAppend.append(formatQualifIntern(ci.pkTable, ci.pkTableSchema, prefs));
+ sbToAppend.append("\n");
sbToAppend.append("(\n");
for (int j = 0; j < ci.pkCols.size(); j++)
{
@@ -2626,27 +2644,26 @@
sbToAppend.append(")");
-
boolean overrideUpdate = prefs.isDeleteRefAction();
String conditionClause = " ON DELETE ";
String overrideAction = prefs.getRefActionByType(prefs.getDeleteAction());
int rule = ci.deleteRule;
-
- String onDeleteClause =
+
+ final String onDeleteClause =
constructFKContraintActionClause(overrideUpdate, conditionClause, overrideAction, rule);
-
+
sbToAppend.append(onDeleteClause);
-
+
overrideUpdate = prefs.isUpdateRefAction();
conditionClause = " ON UPDATE ";
overrideAction = prefs.getRefActionByType(prefs.getUpdateAction());
rule = ci.updateRule;
-
- String onUpdateClause =
+
+ final String onUpdateClause =
constructFKContraintActionClause(overrideUpdate, conditionClause, overrideAction, rule);
sbToAppend.append(onUpdateClause);
- //sbToAppend.append("\n");
+ // sbToAppend.append("\n");
result.add(sbToAppend.toString());
sbToAppend.setLength(0);
}
@@ -2654,112 +2671,120 @@
return result;
}
- private static String formatQualifIntern(String table, String schema, CreateScriptPreferences prefs)
- {
- return formatQualified(table, schema, prefs.isQualifyTableNames(), prefs.isUseDoubleQuotes());
- }
+ private static String formatQualifIntern(String table, String schema, CreateScriptPreferences prefs)
+ {
+ return formatQualified(table, schema, prefs.isQualifyTableNames(), prefs.isUseDoubleQuotes());
+ }
- public static String formatQualified(String table, String schema, boolean qualifyTableNames, boolean useDoubleQuotes)
- {
- if(qualifyTableNames && null != schema && 0 < schema.trim().length())
- {
- if(useDoubleQuotes)
- {
- return "\"" + schema + "\".\"" + table + "\"";
- }
- else
- {
- return schema + "." + table;
- }
- }
- else
- {
- return table;
- }
- }
+ public static String formatQualified(String table, String schema, boolean qualifyTableNames,
+ boolean useDoubleQuotes)
+ {
+ if (qualifyTableNames && null != schema && 0 < schema.trim().length())
+ {
+ if (useDoubleQuotes)
+ {
+ return "\"" + schema + "\".\"" + table + "\"";
+ }
+ else
+ {
+ return schema + "." + table;
+ }
+ }
+ else
+ {
+ return table;
+ }
+ }
- private static String constructFKContraintActionClause(boolean override, String conditionClause,
+ private static String constructFKContraintActionClause(boolean override, String conditionClause,
String overrideAction, int rule)
{
// Bug 2531193: Oracle create table script the "ON UPDATE" is wrong
- StringBuilder tmp = new StringBuilder();
- if (override) {
- if ("NO ACTION".equals(overrideAction)) {
+ final StringBuilder tmp = new StringBuilder();
+ if (override)
+ {
+ if ("NO ACTION".equals(overrideAction))
+ {
return "";
- } else {
+ }
+ else
+ {
tmp.append(conditionClause);
tmp.append(overrideAction);
return tmp.toString();
}
}
-
+
switch (rule)
{
case DatabaseMetaData.importedKeyCascade:
tmp.append(conditionClause);
- if (override) {
+ if (override)
+ {
tmp.append(overrideAction);
- } else {
+ }
+ else
+ {
tmp.append("CASCADE");
}
break;
case DatabaseMetaData.importedKeySetNull:
- if (override) {
+ if (override)
+ {
tmp.append(overrideAction);
- } else {
+ }
+ else
+ {
tmp.append("SET NULL");
}
break;
case DatabaseMetaData.importedKeySetDefault:
- if (override) {
+ if (override)
+ {
tmp.append(overrideAction);
- } else {
+ }
+ else
+ {
tmp.append("SET DEFAULT");
}
break;
case DatabaseMetaData.importedKeyRestrict:
case DatabaseMetaData.importedKeyNoAction:
default:
- // Append nothing - standard says this is equivalent to NO ACTION and some DBs
+ // Append nothing - standard says this is equivalent to NO ACTION
+ // and some DBs
// (e.g. Oracle don't accept ... NO ACTION)
}
return tmp.toString();
}
-
+
private static ConstraintInfo[] getConstraintInfos(ITableInfo ti, ISQLDatabaseMetaData md)
throws SQLException
{
- final ArrayList<ConstraintInfo> ret = new ArrayList<ConstraintInfo>();
- final ForeignKeyInfo[] fkinfos = md.getImportedKeysInfo(ti);
- for (final ForeignKeyInfo fkinfo : fkinfos)
- {
- final Vector<String> fkCols = new Vector<String>();
- final Vector<String> pkCols = new Vector<String>();
+ final ArrayList<ConstraintInfo> ret = new ArrayList<ConstraintInfo>();
+ final ForeignKeyInfo[] fkinfos = md.getImportedKeysInfo(ti);
+ for (final ForeignKeyInfo fkinfo : fkinfos)
+ {
+ final Vector<String> fkCols = new Vector<String>();
+ final Vector<String> pkCols = new Vector<String>();
+ for (final ForeignKeyColumnInfo fkCol : fkinfo.getForeignKeyColumnInfo())
+ {
+ fkCols.add(fkCol.getForeignKeyColumnName());
+ pkCols.add(fkCol.getPrimaryKeyColumnName());
+ }
- for (ForeignKeyColumnInfo fkCol : fkinfo.getForeignKeyColumnInfo())
- {
- fkCols.add(fkCol.getForeignKeyColumnName());
- pkCols.add(fkCol.getPrimaryKeyColumnName());
- }
+ final ConstraintInfo ci =
+ new ConstraintInfo(fkinfo.getForeignKeyTableName(), fkinfo.getForeignKeySchemaName(),
+ fkinfo.getPrimaryKeyTableName(), fkinfo.getPrimaryKeySchemaName(), fkinfo.getSimpleName(),
+ fkCols, pkCols, (short) fkinfo.getDeleteRule(), (short) fkinfo.getUpdateRule());
- ConstraintInfo ci = new ConstraintInfo(
- fkinfo.getForeignKeyTableName(),
- fkinfo.getForeignKeySchemaName(),
- fkinfo.getPrimaryKeyTableName(),
- fkinfo.getPrimaryKeySchemaName(),
- fkinfo.getSimpleName(),
- fkCols,
- pkCols,
- (short) fkinfo.getDeleteRule(),
- (short) fkinfo.getUpdateRule());
+ ret.add(ci);
- ret.add(ci);
+ }
+ return ret.toArray(new ConstraintInfo[ret.size()]);
+ }
- }
- return ret.toArray(new ConstraintInfo[ret.size()]);
- }
-
private static List<PrimaryKeyInfo> getPrimaryKeyInfo(ISQLDatabaseMetaData md, ITableInfo ti,
boolean isJdbcOdbc)
{
@@ -2857,7 +2882,8 @@
final String columnName = shapeIdentifier(column.getColumnName(), prefs, dialect);
final String sequenceName = shapeIdentifier(tableName + "_" + columnName + "_" + "seq", prefs, dialect);
- // TODO Probably want to allow the user to set these sequence properties ??
+ // TODO Probably want to allow the user to set these sequence properties
+ // ??
// Sequence settings.
final String sequenceIncrement = "1";
final String minimum = "1";
@@ -3080,4 +3106,26 @@
return strWithQuotes.replaceAll(tmp.toString(), identifier);
}
+ /**
+ * Converts the specified byte array into a String containing hex characters that represent the nibbles
+ * that form the butes in the array.
+ *
+ * @param bytes
+ * the byte array to convert
+ * @return a hex string representing the bytes in the specified byte array.
+ */
+ public static String toHexString(byte[] bytes)
+ {
+ final char[] hexArray =
+ { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
+ final char[] hexChars = new char[bytes.length * 2];
+ int v;
+ for (int j = 0; j < bytes.length; j++)
+ {
+ v = bytes[j] & 0xFF;
+ hexChars[j * 2] = hexArray[v / 16];
+ hexChars[j * 2 + 1] = hexArray[v % 16];
+ }
+ return new String(hexChars);
+ }
}
Modified: trunk/sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/dialects/HibernateDialect.java
===================================================================
--- trunk/sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/dialects/HibernateDialect.java 2011-05-16 18:22:36 UTC (rev 6262)
+++ trunk/sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/dialects/HibernateDialect.java 2011-05-17 01:11:28 UTC (rev 6263)
@@ -30,44 +30,47 @@
import org.hibernate.HibernateException;
/**
- * An interface for methods implemented by database dialects for the purpose of handling standard and
- * non-standard SQL and database types.
+ * An interface for methods implemented by database dialects for the purpose of
+ * handling standard and non-standard SQL and database types.
*/
-public interface HibernateDialect extends StringTemplateConstants
-{
+public interface HibernateDialect extends StringTemplateConstants {
/**
- * Get the name of the database type associated with the given <tt>java.sql.Types</tt> typecode.
+ * Get the name of the database type associated with the given
+ * <tt>java.sql.Types</tt> typecode.
*
* @param code
- * <tt>java.sql.Types</tt> typecode
+ * <tt>java.sql.Types</tt> typecode
* @param length
- * the length or precision of the column
+ * the length or precision of the column
* @param precision
- * the precision of the column
+ * the precision of the column
* @param scale
- * the scale of the column
+ * the scale of the column
* @return the database type name
* @throws HibernateException
*/
- String getTypeName(int code, int length, int precision, int scale) throws HibernateException;
+ String getTypeName(int code, int length, int precision, int scale)
+ throws HibernateException;
/**
- * Get the name of the database type associated with the given {@link java.sql.Types} typecode.
+ * Get the name of the database type associated with the given
+ * {@link java.sql.Types} typecode.
*
* @param code
- * The {@link java.sql.Types} typecode
+ * The {@link java.sql.Types} typecode
* @return the database type name
* @throws HibernateException
- * If no mapping was specified for that type.
+ * If no mapping was specified for that type.
*/
public String getTypeName(int code) throws HibernateException;
/**
- * 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)
+ * 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)
*
* @param info
* @return
@@ -75,205 +78,237 @@
boolean canPasteTo(IDatabaseObjectInfo info);
/**
- * Returns a boolean value indicating whether or not this database dialect supports table creation
- * statements where the table name is prefixed by the schema.
+ * Returns a boolean value indicating whether or not this database dialect
+ * supports table creation statements where the table name is prefixed by
+ * the schema.
*
* @return
*/
boolean supportsSchemasInTableDefinition();
/**
- * Returns the string that should be appended to a column declaration when nulls are allowed in the column.
+ * Returns the string that should be appended to a column declaration when
+ * nulls are allowed in the column.
*
- * @return the "nulls are allowed in this column" string for a table declaration
+ * @return the "nulls are allowed in this column" string for a table
+ * declaration
*/
String getNullColumnString();
/**
- * Returns the name of the aggregate function that determines the max value of an expression.
+ * Returns the name of the aggregate function that determines the max value
+ * of an expression.
*
- * @return the name of the function to be applied to a set to determine the element with the highest
- * numeric value.
+ * @return the name of the function to be applied to a set to determine the
+ * element with the highest numeric value.
*/
String getMaxFunction();
/**
- * Returns the name of the function that measures the length of a character string.
+ * Returns the name of the function that measures the length of a character
+ * string.
*
* @param dataType
- * the java.sql.Types data type. Some databases have different length functions for different
- * data types.
- * @return the name of the function to be applied to a column to determine the length of that column in a
- * particular record.
+ * the java.sql.Types data type. Some databases have different
+ * length functions for different data types.
+ * @return the name of the function to be applied to a column to determine
+ * the length of that column in a particular record.
*/
String getLengthFunction(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. If the HibernateDialect implementation doesn't
- * ever use $p in any call to registerColumnType(), then this maximum precsision will not be used.
+ * 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.
*
* @param dataType
- * the java.sql.Types data type.
- * @return the maximum number that can be used in a column declaration for precision for the specified
- * type.
+ * the java.sql.Types data type.
+ * @return the maximum number that can be used in a column declaration for
+ * precision for the specified type.
*/
int getMaxPrecision(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. If the HibernateDialect implementation doesn't ever
- * use $s in any call to registerColumnType(), then this maximum scale will not be used.
+ * 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.
*
* @param dataType
- * the java.sql.Types data type.
- * @return the maximum number that can be used in a column declaration for scale for the specified type.
+ * the java.sql.Types data type.
+ * @return the maximum number that can be used in a column declaration for
+ * scale for the specified type.
*/
int getMaxScale(int dataType);
/**
- * 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.
+ * 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.
*
* @param columnSize
- * the size of the column as reported by the driver.
+ * the size of the column as reported by the driver.
* @param dataType
- * the java.sql.Types data type.
- * @return a number indicating the total number of digits (includes both sides of the decimal point) the
- * column can represent.
+ * the java.sql.Types data type.
+ * @return a number indicating the total number of digits (includes both
+ * sides of the decimal point) the column can represent.
*/
int getPrecisionDigits(int columnSize, int dataType);
/**
- * 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.
+ * 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.
*
* @param columnSize
- * the size of the column as reported by the jdbc driver
+ * the size of the column as reported by the jdbc driver
* @param dataType
- * the type of the column.
- * @return the specified columnSize if the jdbc driver isn't broken; otherwise, the maximum column size for
- * the specified dataType if the driver is broken.
+ * the type of the column.
+ * @return the specified columnSize if the jdbc driver isn't broken;
+ * otherwise, the maximum column size for the specified dataType if
+ * the driver is broken.
*/
int getColumnLength(int columnSize, int dataType);
/**
- * Returns boolean value indicating whether or not this dialect supports the specified database
- * product/version.
+ * Returns boolean value indicating whether or not this dialect supports the
+ * specified database product/version.
*
* @param databaseProductName
- * the name of the database as reported by DatabaseMetaData.getDatabaseProductName()
+ * the name of the database as reported by
+ * DatabaseMetaData.getDatabaseProductName()
* @param databaseProductVersion
- * the version of the database as reported by DatabaseMetaData.getDatabaseProductVersion()
- * @return true if this dialect can be used for the specified product name and version; false otherwise.
+ * the version of the database as reported by
+ * DatabaseMetaData.getDatabaseProductVersion()
+ * @return true if this dialect can be used for the specified product name
+ * and version; false otherwise.
*/
- boolean supportsProduct(String databaseProductName, String databaseProductVersion);
+ boolean supportsProduct(String databaseProductName,
+ String databaseProductVersion);
/**
* The string which identifies this dialect in the dialect chooser.
*
- * @return a descriptive name that tells the user what database this dialect is design to work with.
+ * @return a descriptive name that tells the user what database this dialect
+ * is design to work with.
*/
String getDisplayName();
/**
- * Returns a boolean value indicating whether or not this dialect supports adding comments to columns.
+ * Returns a boolean value indicating whether or not this dialect supports
+ * adding comments to columns.
*
* @return true if column comments are supported; false otherwise.
*/
boolean supportsColumnComment();
/**
- * Returns the SQL statement to use to add a comment to the specified column of the specified table.
+ * Returns the SQL statement to use to add a comment to the specified column
+ * of the specified table.
*
* @param info
- * information about the column such as type, name, etc.
+ * information about the column such as type, name, etc.
* @param qualifier
- * qualifier of the table
+ * qualifier of the table
* @param prefs
- * preferences for generated sql scripts
+ * preferences for generated sql scripts
* @return
* @throws UnsupportedOperationException
- * if the database doesn't support annotating columns with a comment.
+ * if the database doesn't support annotating columns with a
+ * comment.
*/
- public String getColumnCommentAlterSQL(TableColumnInfo info, DatabaseObjectQualifier qualifier,
- SqlGenerationPreferences prefs) throws UnsupportedOperationException;
+ public String getColumnCommentAlterSQL(TableColumnInfo info,
+ DatabaseObjectQualifier qualifier, SqlGenerationPreferences prefs)
+ throws UnsupportedOperationException;
/**
- * Returns a boolean value indicating whether or not this database dialect supports dropping columns from
- * tables.
+ * Returns a boolean value indicating whether or not this database dialect
+ * supports dropping columns from tables.
*
* @return true if the database supports dropping columns; false otherwise.
*/
boolean supportsDropColumn();
/**
- * Returns a boolean value indicating whether or not this database dialect supports changing a column from
- * null to not-null and vice versa.
+ * Returns a boolean value indicating whether or not this database dialect
+ * supports changing a column from null to not-null and vice versa.
*
* @return true if the database supports dropping columns; false otherwise.
*/
boolean supportsAlterColumnNull();
/**
- * Returns the SQL that forms the command to drop the specified colum in the specified table.
+ * Returns the SQL that forms the command to drop the specified colum in the
+ * specified table.
*
* @param tableName
- * the name of the table that has the column
+ * the name of the table that has the column
* @param columnName
- * the name of the column to drop.
+ * the name of the column to drop.
* @param qualifier
- * qualifier of the table
+ * qualifier of the table
* @param prefs
- * preferences for generated sql scripts
+ * preferences for generated sql scripts
* @return the sql for dropping the specified column
- * @throw UnsupportedOperationException if the database doesn't support dropping columns.
+ * @throw UnsupportedOperationException if the database doesn't support
+ * dropping columns.
*/
- String getColumnDropSQL(String tableName, String columnName, DatabaseObjectQualifier qualifier,
- SqlGenerationPreferences prefs) throws UnsupportedOperationException;
+ String getColumnDropSQL(String tableName, String columnName,
+ DatabaseObjectQualifier qualifier, SqlGenerationPreferences prefs)
+ throws UnsupportedOperationException;
/**
- * 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.
+ * 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.
*
* @param iTableInfo
- * the table to drop
+ * the table to drop
* @param cascadeConstraints
- * whether or not to drop any FKs that may reference the specified table.
+ * whether or not to drop any FKs that may reference the
+ * specified table.
* @param isMaterializedView
- * whether or not the specified table info is actually a materialized view
+ * whether or not the specified table info is actually a
+ * materialized view
* @param qualifier
- * qualifier of the table
+ * qualifier of the table
* @param prefs
- * preferences for generated sql scripts
+ * preferences for generated sql scripts
* @return the drop SQL command.
*/
- List<String> getTableDropSQL(ITableInfo iTableInfo, boolean cascadeConstraints,
- boolean isMaterializedView, DatabaseObjectQualifier qualifier, SqlGenerationPreferences prefs);
+ List<String> getTableDropSQL(ITableInfo iTableInfo,
+ boolean cascadeConstraints, boolean isMaterializedView,
+ DatabaseObjectQualifier qualifier, SqlGenerationPreferences prefs);
/**
- * Returns the SQL that forms the command to add a primary key to the specified table composed of the given
- * column names.
+ * Returns the SQL that forms the command to add a primary key to the
+ * specified table composed of the given column names.
*
* @param pkName
- * the name of the constraint
+ * the name of the constraint
* @param ti
- * the table to add a primary key to
+ * the table to add a primary key to
* @param qualifier
- * qualifier of the table
+ * qualifier of the table
* @param prefs
- * preferences for generated sql scripts
+ * preferences for generated sql scripts
* @param columnNames
- * the columns that form the key
+ * the columns that form the key
* @return
*/
- String[] getAddPrimaryKeySQL(String pkName, TableColumnInfo[] colInfos, ITableInfo ti,
- DatabaseObjectQualifier qualifier, SqlGenerationPreferences prefs);
+ String[] getAddPrimaryKeySQL(String pkName, TableColumnInfo[] colInfos,
+ ITableInfo ti, DatabaseObjectQualifier qualifier,
+ SqlGenerationPreferences prefs);
/**
* Returns the SQL fragment for adding a column in an alter table statement.
@@ -286,20 +321,22 @@
* Returns the SQL used to alter the nullability of the specified column
*
* @param info
- * the column to modify
+ * the column to modify
* @param qualifier
- * qualifier of the table
+ * qualifier of the table
* @param prefs
- * preferences for generated sql scripts
+ * preferences for generated sql scripts
* @return the SQL to execute
*/
- String[] getColumnNullableAlterSQL(TableColumnInfo info, DatabaseObjectQualifier qualifier,
- SqlGenerationPreferences prefs);
+ String[] getColumnNullableAlterSQL(TableColumnInfo info,
+ DatabaseObjectQualifier qualifier, SqlGenerationPreferences prefs);
/**
- * Returns a boolean value indicating whether or not this database dialect supports renaming columns.
+ * Returns a boolean value indicating whether or not this database dialect
+ * supports renaming columns.
*
- * @return true if the database supports changing the name of columns; false otherwise.
+ * @return true if the database supports changing the name of columns; false
+ * otherwise.
*/
boolean supportsRenameColumn();
@@ -307,20 +344,21 @@
* Returns the SQL that is used to change the column name.
*
* @param from
- * the TableColumnInfo as it is
+ * the TableColumnInfo as it is
* @param to
- * the TableColumnInfo as it wants to be
+ * the TableColumnInfo as it wants to be
* @param qualifier
- * qualifier of the table
+ * qualifier of the table
* @param prefs
- * preferences for generated sql scripts
+ * preferences for generated sql scripts
* @return the SQL to make the change
*/
- String getColumnNameAlterSQL(TableColumnInfo from, TableColumnInfo to, DatabaseObjectQualifier qualifier,
- SqlGenerationPreferences prefs);
+ String getColumnNameAlterSQL(TableColumnInfo from, TableColumnInfo to,
+ DatabaseObjectQualifier qualifier, SqlGenerationPreferences prefs);
/**
- * Returns a boolean value indicating whether or not this dialect supports modifying a columns type.
+ * Returns a boolean value indicating whether or not this dialect supports
+ * modifying a columns type.
*
* @return true if supported; false otherwise
*/
@@ -330,28 +368,32 @@
* Returns the SQL that is used to change the column type.
*
* @param from
- * the TableColumnInfo as it is
+ * the TableColumnInfo as it is
* @param to
- * the TableColumnInfo as it wants to be
+ * the TableColumnInfo as it wants to be
* @param qualifier
- * qualifier of the table
+ * qualifier of the table
* @param prefs
- * preferences for generated sql scripts
+ * preferences for generated sql scripts
* @param qualifier
- * qualifier of the table
+ * qualifier of the table
* @param prefs
- * preferences for generated sql scripts
+ * preferences for generated sql scripts
* @return the SQL to make the change
- * @throw UnsupportedOperationException if the database doesn't support modifying column types.
+ * @throw UnsupportedOperationException if the database doesn't support
+ * modifying column types.
*/
- List<String> getColumnTypeAlterSQL(TableColumnInfo from, TableColumnInfo to,
- DatabaseObjectQualifier qualifier, SqlGenerationPreferences prefs) throws UnsupportedOperationException;
+ List<String> getColumnTypeAlterSQL(TableColumnInfo from,
+ TableColumnInfo to, DatabaseObjectQualifier qualifier,
+ SqlGenerationPreferences prefs)
+ throws UnsupportedOperationException;
/**
- * Returns a boolean value indicating whether or not this database dialect supports changing a column's
- * default value.
+ * Returns a boolean value indicating whether or not this database dialect
+ * supports changing a column's default value.
*
- * @return true if the database supports modifying column defaults; false otherwise
+ * @return true if the database supports modifying column defaults; false
+ * otherwise
*/
boolean supportsAlterColumnDefault();
@@ -359,85 +401,91 @@
* Returns the SQL command to change the specified column's default value
*
* @param info
- * the column to modify and it's default value.
+ * the column to modify and it's default value.
* @param qualifier
- * qualifier of the table
+ * qualifier of the table
* @param prefs
- * preferences for generated sql scripts
+ * preferences for generated sql scripts
* @return SQL to make the change
*/
- String getColumnDefaultAlterSQL(TableColumnInfo info, DatabaseObjectQualifier qualifier,
- SqlGenerationPreferences prefs);
+ String getColumnDefaultAlterSQL(TableColumnInfo info,
+ DatabaseObjectQualifier qualifier, SqlGenerationPreferences prefs);
/**
* Returns the SQL command to drop the specified table's primary key.
*
* @param pkName
- * the name of the primary key that should be dropped
+ * the name of the primary key that should be dropped
* @param tableName
- * the name of the table whose primary key should be dropped
+ * the name of the table whose primary key should be dropped
* @param qualifier
- * qualifier of the table
+ * qualifier of the table
* @param prefs
- * preferences for generated sql scripts
+ * preferences for generated sql scripts
* @return
*/
- String getDropPrimaryKeySQL(String pkName, String tableName, DatabaseObjectQualifier qualifier,
- SqlGenerationPreferences prefs);
+ String getDropPrimaryKeySQL(String pkName, String tableName,
+ DatabaseObjectQualifier qualifier, SqlGenerationPreferences prefs);
/**
- * Returns the SQL command to drop the specified table's foreign key constraint.
+ * Returns the SQL command to drop the specified table's foreign key
+ * constraint.
*
* @param fkName
- * the name of the foreign key that should be dropped
+ * the name of the foreign key that should be dropped
* @param tableName
- * the name of the table whose foreign key should be dropped
+ * the name of the table whose foreign key should be dropped
* @param qualifier
- * qualifier of the table
+ * qualifier of the table
* @param prefs
- * preferences for generated sql scripts
+ * preferences for generated sql scripts
* @return
*/
- String getDropForeignKeySQL(String fkName, String tableName, DatabaseObjectQualifier qualifier,
- SqlGenerationPreferences prefs);
+ String getDropForeignKeySQL(String fkName, String tableName,
+ DatabaseObjectQualifier qualifier, SqlGenerationPreferences prefs);
/**
- * Returns the SQL command to create the specified table (columns appear in the same order as they are
- * stored in the database).
+ * Returns the SQL command to create the specified table (columns appear in
+ * the same order as they are stored in the database).
*
* @param tables
- * the tables to get create statements for
+ * the tables to get create statements for
* @param md
- * the metadata from the ISession
+ * the metadata from the ISession
* @param prefs
- * preferences about how the resultant SQL commands should be formed.
+ * preferences about how the resultant SQL commands should be
+ * formed.
* @param isJdbcOdbc
- * whether or not the connection is via JDBC-ODBC bridge.
+ * whether or not the connection is via JDBC-ODBC bridge.
* @return the SQL that is used to create the specified table
*/
- List<String> getCreateTableSQL(List<ITableInfo> tables, ISQLDatabaseMetaData md,
- CreateScriptPreferences prefs, boolean isJdbcOdbc) throws SQLException;
+ List<String> getCreateTableSQL(List<ITableInfo> tables,
+ ISQLDatabaseMetaData md, CreateScriptPreferences prefs,
+ boolean isJdbcOdbc) throws SQLException;
/**
- * Returns the SQL command to create the specified table. Optionally, if sortColumns is true, colums will
- * be sorted by column name in ascending order.
+ * Returns the SQL command to create the specified table. Optionally, if
+ * sortColumns is true, colums will be sorted by column name in ascending
+ * order.
*
* @param tables
- * the tables to get create statements for
+ * the tables to get create statements for
* @param md
- * the metadata from the ISession
+ * the metadata from the ISession
* @param prefs
- * preferences about how the resultant SQL commands should be formed.
+ * preferences about how the resultant SQL commands should be
+ * formed.
* @param isJdbcOdbc
- * whether or not the connection is via JDBC-ODBC bridge.
+ * whether or not the connection is via JDBC-ODBC bridge.
* @param sortColumns
- * whether or not to sort columns according to their column name.
+ * whether or not to sort columns according to their column name.
*
* @return the SQL that is used to create the specified table
*/
- List<String> getCreateTableSQL(List<ITableInfo> tables, ISQLDatabaseMetaData md,
- CreateScriptPreferences prefs, boolean isJdbcOdbc, boolean sortColumns) throws SQLException;
-
+ List<String> getCreateTableSQL(List<ITableInfo> tables,
+ ISQLDatabaseMetaData md, CreateScriptPreferences prefs,
+ boolean isJdbcOdbc, boolean sortColumns) throws SQLException;
+
/**
* Returns the DialectType enum value associated with this dialect.
*
@@ -446,199 +494,228 @@
DialectType getDialectType();
/**
- * Returns a boolean value indicating whether or not this database dialect supports sequences.
+ * Returns a boolean value indicating whether or not this database dialect
+ * supports sequences.
*
* @return true if the database supports sequence; false otherwise.
*/
public boolean supportsSequence();
/**
- * Returns a boolean value indicating whether or not this database dialect suports tablespaces.
- * Specifically, when creating an index, some databases allow a tablespace to be specified to create the
- * index in, recognizing that indexes can be quite large.
+ * Returns a boolean value indicating whether or not this database dialect
+ * suports tablespaces. Specifically, when creating an index, some databases
+ * allow a tablespace to be specified to create the index in, recognizing
+ * that indexes can be quite large.
*
* @return true if the database supports tablespaces; false otherwise.
*/
public boolean supportsTablespace();
/**
- * Returns a boolean value indicating whether or not this database dialect supports indexes.
+ * Returns a boolean value indicating whether or not this database dialect
+ * supports indexes.
*
* @return true if the database supports indexes; false otherwise.
*/
public boolean supportsIndexes();
/**
- * Returns a boolean value indicating whether or not this database dialect supports access methods.
+ * Returns a boolean value indicating whether or not this database dialect
+ * supports access methods.
*
* @return true if the database supports access methods; false otherwise.
*/
public boolean supportsAccessMethods();
/**
- * Returns a boolean value indicating whether or not this database dialect supports auto-increment on
- * columns.
+ * Returns a boolean value indicating whether or not this database dialect
+ * supports auto-increment on columns.
*
* @return true if the database supports auto-increment; false otherwise.
*/
public boolean supportsAutoIncrement();
/**
- * Returns a boolean value indicating whether or not this database dialect supports check options for
- * views.
+ * Returns a boolean value indicating whether or not this database dialect
+ * supports check options for views.
*
- * @return true if the database supports check options for views; false otherwise.
+ * @return true if the database supports check options for views; false
+ * otherwise.
*/
public boolean supportsCheckOptionsForViews();
/**
- * Returns a boolean value indicating whether or not this database dialect supports empty tables.
+ * Returns a boolean value indicating whether or not this database dialect
+ * supports empty tables.
*
* @return true if the database supports empty tables; false otherwise.
*/
public boolean supportsEmptyTables();
/**
- * Returns a boolean value indicating whether or not this database dialect supports the optional SQL
- * feature "row value constructors" (F641) that allows to insert multiple rows in a single insert
- * statement.
+ * Returns a boolean value indicating whether or not this database dialect
+ * supports the optional SQL feature "row value constructors" (F641) that
+ * allows to insert multiple rows in a single insert statement.
*
- * @return true if the database supports multiple row inserts; false otherwise.
+ * @return true if the database supports multiple row inserts; false
+ * otherwise.
*/
public boolean supportsMultipleRowInserts();
/**
- * Returns a boolean value indicating whether or not this database dialect supports adding columns to
- * existing tables
+ * Returns a boolean value indicating whether or not this database dialect
+ * supports adding columns to existing tables
*
* @return true if the database supports adding columns; false otherwise.
*/
public boolean supportsAddColumn();
/**
- * Returns a boolean value indicating whether or not this database dialect supports adding foreign key
- * constraints.
+ * Returns a boolean value indicating whether or not this database dialect
+ * supports adding foreign key constraints.
*
- * @return true if the database supports adding foreign key constraints; false otherwise.
+ * @return true if the database supports adding foreign key constraints;
+ * false otherwise.
*/
public boolean supportsAddForeignKeyConstraint();
/**
- * Returns a boolean value indicating whether or not this database dialect supports adding unique
- * constraints.
+ * Returns a boolean value indicating whether or not this database dialect
+ * supports adding unique constraints.
*
- * @return true if the database supports adding unique constraints; false otherwise.
+ * @return true if the database supports adding unique constraints; false
+ * otherwise.
*/
public boolean supportsAddUniqueConstraint();
/**
- * Returns a boolean value indicating whether or not this database dialect supports altering sequences.
+ * Returns a boolean value indicating whether or not this database dialect
+ * supports altering sequences.
*
- * @return true if the database supports altering sequences; false otherwise.
+ * @return true if the database supports altering sequences; false
+ * otherwise.
*/
public boolean supportsAlterSequence();
/**
- * Returns a boolean value indicating whether or not this database dialect supports creating indexes.
+ * Returns a boolean value indicating whether or not this database dialect
+ * supports creating indexes.
*
* @return true if the database supports creating indexes; false otherwise.
*/
public boolean supportsCreateIndex();
/**
- * Returns a boolean value indicating whether or not this database dialect supports creating sequences.
+ * Returns a boolean value indicating whether or not this database dialect
+ * supports creating sequences.
*
- * @return true if the database supports creating sequences; false otherwise.
+ * @return true if the database supports creating sequences; false
+ * otherwise.
*/
public boolean supportsCreateSequence();
/**
- * Returns a boolean value indicating whether or not this database dialect supports creating tables.
+ * Returns a boolean value indicating whether or not this database dialect
+ * supports creating tables.
*
* @return true if the database supports creating tables; false otherwise.
*/
public boolean supportsCreateTable();
/**
- * Returns a boolean value indicating whether or not this database dialect supports creating views.
+ * Returns a boolean value indicating whether or not this database dialect
+ * supports creating views.
*
* @return true if the database supports creating views; false otherwise.
*/
public boolean supportsCreateView();
/**
- * Returns a boolean value indicating whether or not this database dialect supports dropping constraints.
+ * Returns a boolean value indicating whether or not this database dialect
+ * supports dropping constraints.
*
- * @return true if the database supports dropping constraints; false otherwise.
+ * @return true if the database supports dropping constraints; false
+ * otherwise.
*/
public boolean supportsDropConstraint();
/**
- * Returns a boolean value indicating whether or not this database dialect supports dropping indexes.
+ * Returns a boolean value indicating whether or not this database dialect
+ * supports dropping indexes.
*
* @return true if the database supports dropping indexes; false otherwise.
*/
public boolean supportsDropIndex();
/**
- * Returns a boolean value indicating whether or not this database dialect supports dropping sequences.
+ * Returns a boolean value indicating whether or not this database dialect
+ * supports dropping sequences.
*
- * @return true if the database supports dropping sequences; false otherwise.
+ * @return true if the database supports dropping sequences; false
+ * otherwise.
*/
public boolean supportsDropSequence();
/**
- * Returns a boolean value indicating whether or not this database dialect supports dropping views.
+ * Returns a boolean value indicating whether or not this data...
[truncated message content] |