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.
|
String |
getAnalyzeTableSql(String catalog,
String schema,
String table)
Return null.
|
String |
getCreateForeignKeySql(String catalog,
String schema,
String table,
String name,
Set<String> columns,
String refTable,
Set<String> refColumns)
Generates SQL that creates a foreign key constraint between two tables.
|
String |
getCreateIndexSql(String catalog,
String schema,
String table,
String name,
Set<String> columns,
boolean unique)
Generates
CREATE [UNIQUE] INDEX <name> ON
<catalog>. |
String |
getCreatePrimaryKeySql(String catalog,
String schema,
String table,
String name,
Set<String> columns)
Generate SQL to create a primary key for a table.
|
String |
getDropForeignKeySql(String catalog,
String schema,
String table,
String name)
Generate
ALTER TABLE <catalog>. |
String |
getDropIndexSql(String catalog,
String schema,
String table,
String name,
boolean unique)
Generate
DROP INDEX <catalog>. |
String |
getDropPrimaryKey(String catalog,
String schema,
String table,
String name)
Generate SQL that drops the primary key from a table.
|
String |
getInsertAutoIncrementSql(PersistentClass pc)
Return a SQL fragment that can be used in an INSERT INTO statement
to generate an ID for new rows.
|
String |
getOptimizeTableSql(String catalog,
String schema,
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 String getCreateIndexSql(String catalog, String schema, String table, String name, Set<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 String getDropIndexSql(String catalog, String schema, String table, 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 String getDropForeignKeySql(String catalog, String schema, String table, 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 String getInsertAutoIncrementSql(PersistentClass pc)
DbEngine
pc
- The persistent classpublic boolean analyzeAfterBatchOperation()
public String getOptimizeTableSql(String catalog, String schema, 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 String getAnalyzeTableSql(String catalog, String schema, 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 String getCreateForeignKeySql(String catalog, String schema, String table, String name, Set<String> columns, String refTable, Set<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 String getCreatePrimaryKeySql(String catalog, String schema, String table, String name, Set<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 String getDropPrimaryKey(String catalog, String schema, String table, 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