|
3.1.1: 2012-03-29 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.basedb.core.dbengine.AbstractDbEngine
net.sf.basedb.core.dbengine.DefaultDbEngine
public class DefaultDbEngine
A default DbEngine that is selected if no other can be found. This probably has some issues with most databases.
| Constructor Summary | |
|---|---|
DefaultDbEngine()
Create DefaultDbEngine. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultDbEngine()
| Method Detail |
|---|
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 not
public 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 not
public 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 key
public String getInsertAutoIncrementSql(PersistentClass pc)
DbEngine
pc - The persistent class
public 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 optimize
DbEngine.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 analyze
DbEngine.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 key
public 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 key
public 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
|
3.1.1: 2012-03-29 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||