public class DefaultDbEngine extends AbstractDbEngine
Constructor and Description |
---|
DefaultDbEngine()
Create DefaultDbEngine.
|
Modifier and Type | Method and Description |
---|---|
boolean |
analyzeAfterBatchOperation()
Return false.
|
boolean |
caseInsensitiveComparison()
Returns TRUE.
|
java.lang.String |
getAnalyzeTableSql(java.lang.String catalog,
java.lang.String schema,
java.lang.String table)
Return null.
|
java.lang.String |
getCreateForeignKeySql(java.lang.String catalog,
java.lang.String schema,
java.lang.String table,
java.lang.String name,
java.util.Set<java.lang.String> columns,
java.lang.String refTable,
java.util.Set<java.lang.String> refColumns)
Generates SQL that creates a foreign key constraint between two tables.
|
java.lang.String |
getCreateIndexSql(java.lang.String catalog,
java.lang.String schema,
java.lang.String table,
java.lang.String name,
java.util.Set<java.lang.String> columns,
boolean unique)
Generates
CREATE [UNIQUE] INDEX <name> ON
<catalog>. |
java.lang.String |
getCreatePrimaryKeySql(java.lang.String catalog,
java.lang.String schema,
java.lang.String table,
java.lang.String name,
java.util.Set<java.lang.String> columns)
Generate SQL to create a primary key for a table.
|
java.lang.String |
getDropForeignKeySql(java.lang.String catalog,
java.lang.String schema,
java.lang.String table,
java.lang.String name)
Generate
ALTER TABLE <catalog>. |
java.lang.String |
getDropIndexSql(java.lang.String catalog,
java.lang.String schema,
java.lang.String table,
java.lang.String name,
boolean unique)
Generate
DROP INDEX <catalog>. |
java.lang.String |
getDropPrimaryKey(java.lang.String catalog,
java.lang.String schema,
java.lang.String table,
java.lang.String name)
Generate SQL that drops the primary key from a table.
|
java.lang.String |
getInsertAutoIncrementSql(PersistentClass pc)
Return a SQL fragment that can be used in an INSERT INTO statement
to generate an ID for new rows.
|
java.lang.String |
getOptimizeTableSql(java.lang.String catalog,
java.lang.String schema,
java.lang.String table)
Return null.
|
abs, castToDate, checkForInvalidNumberOperation, exp, getApproximateRowCountSql, getCaseSensitiveVarchar, getQuotedName, inspectSchemaGenerationSQL, isValidColumnName, isValidName, isValidTableName, ln, makeSafeCreateTable, power, rlike, selectOrderByColumnsIfDistinct, supportColumnAliasInGroupBy, supportColumnAliasInHaving, supportColumnAliasInOrderBy, supportsColumnAliasInWhere, useSavePointToContinueTransactionFromSqlFailure, useThetaJoin
public java.lang.String getCreateIndexSql(java.lang.String catalog, java.lang.String schema, java.lang.String table, java.lang.String name, java.util.Set<java.lang.String> columns, boolean unique)
CREATE [UNIQUE] INDEX <name> ON
<catalog>.<schema>.<table> (<columns>)
which should work for most databases.catalog
- The name of the catalog (database) where the table is
located, or null if it is located in the current catalogschema
- The name of the schema where the table is located, or
null if is located in the current schematable
- The name of the tablename
- The name of the index to be createdcolumns
- The name of the columns in the indexunique
- If the index must contain unique values or notpublic java.lang.String getDropIndexSql(java.lang.String catalog, java.lang.String schema, java.lang.String table, java.lang.String name, boolean unique)
DROP INDEX <catalog>.<schema>.<table>.<name>
.catalog
- The name of the catalog (database) where the table is
located, or null if it is located in the current catalogschema
- The name of the schema where the table is located, or
null if is located in the current schematable
- The name of the tablename
- The name of the indexunique
- If the index contains unique values or notpublic java.lang.String getDropForeignKeySql(java.lang.String catalog, java.lang.String schema, java.lang.String table, java.lang.String name)
ALTER TABLE <catalog>.<schema>.<table> DROP CONSTRAINT <name>
catalog
- The name of the catalog (database) where the table is
located, or null if it is located in the current catalogschema
- The name of the schema where the table is located, or
null if is located in the current schematable
- The name of the tablename
- The name of the foreign keypublic java.lang.String getInsertAutoIncrementSql(PersistentClass pc)
DbEngine
pc
- The persistent classpublic boolean analyzeAfterBatchOperation()
public java.lang.String getOptimizeTableSql(java.lang.String catalog, java.lang.String schema, java.lang.String table)
catalog
- The name of the catalog (database) where the table is
located, or null if it is located in the current catalogschema
- The name of the schema where the table is located, or
null if is located in the current schematable
- The name of the table to optimizeDbEngine.getAnalyzeTableSql(String, String, String)
public java.lang.String getAnalyzeTableSql(java.lang.String catalog, java.lang.String schema, java.lang.String table)
catalog
- The name of the catalog (database) where the table is
located, or null if it is located in the current catalogschema
- The name of the schema where the table is located, or
null if is located in the current schematable
- The name of the table to analyzeDbEngine.getOptimizeTableSql(String, String, String)
public boolean caseInsensitiveComparison()
public java.lang.String getCreateForeignKeySql(java.lang.String catalog, java.lang.String schema, java.lang.String table, java.lang.String name, java.util.Set<java.lang.String> columns, java.lang.String refTable, java.util.Set<java.lang.String> refColumns)
DbEngine
catalog
- The name of the catalog (database) where the tables are
located, or null if it is located in the current catalogschema
- The name of the schema where the tables are located, or
null if is located in the current schematable
- The name of the foreign key tablename
- The name of the foreign keycolumns
- The columns that make up the foreign keyrefTable
- The table that is referenced by the foreign keyrefColumns
- The columns that are referenced by the foreign keypublic java.lang.String getCreatePrimaryKeySql(java.lang.String catalog, java.lang.String schema, java.lang.String table, java.lang.String name, java.util.Set<java.lang.String> columns)
DbEngine
catalog
- The name of the catalog (database) where the table is
located, or null if it is located in the current catalogschema
- The name of the schema where the table is located, or
null if is located in the current schematable
- The name of the tablename
- The name of the primary keycolumns
- The name of the columns in the primary keypublic java.lang.String getDropPrimaryKey(java.lang.String catalog, java.lang.String schema, java.lang.String table, java.lang.String name)
DbEngine
catalog
- The name of the catalog (database) where the table is
located, or null if it is located in the current catalogschema
- The name of the schema where the table is located, or
null if is located in the current schematable
- The name of the tablename
- The name of the primary key