2.17.2: 2011-06-17

net.sf.basedb.core.dbengine
Class DefaultDbEngine

java.lang.Object
  extended by net.sf.basedb.core.dbengine.AbstractDbEngine
      extended by net.sf.basedb.core.dbengine.DefaultDbEngine
All Implemented Interfaces:
DbEngine

public class DefaultDbEngine
extends AbstractDbEngine

A default DbEngine that is selected if no other can be found. This probably has some issues with most databases.

Version:
2.0
Author:
nicklas
Last modified
$Date: 2008-09-11 22:11:02 +0200 (Thu, 11 Sep 2008) $

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 getCreateIndexSql(String catalog, String schema, String table, String name, Set<String> columns, boolean unique)
          Generates CREATE [UNIQUE] INDEX <name> ON <catalog>.
 String getDropIndexSql(String catalog, String schema, String table, String name, boolean unique)
          Generate DROP INDEX <catalog>.
 String getOptimizeTableSql(String catalog, String schema, String table)
          Return null.
private  String getQuotedName(String name)
          Put quotes (") around the name.
 
Methods inherited from class net.sf.basedb.core.dbengine.AbstractDbEngine
abs, castToDate, checkForInvalidNumberOperation, exp, getCaseSensitiveVarchar, inspectSchemaGenerationSQL, isValidColumnName, isValidName, isValidTableName, ln, makeSafeCreateTable, power, rlike, selectOrderByColumnsIfDistinct, supportColumnAliasInGroupBy, supportColumnAliasInHaving, supportColumnAliasInOrderBy, supportsColumnAliasInWhere, useThetaJoin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDbEngine

public DefaultDbEngine()
Create DefaultDbEngine.

Method Detail

getCreateIndexSql

public String getCreateIndexSql(String catalog,
                                String schema,
                                String table,
                                String name,
                                Set<String> columns,
                                boolean unique)
Generates CREATE [UNIQUE] INDEX <name> ON <catalog>.<schema>.<table> (<columns>) which should work for most databases.

Parameters:
catalog - The name of the catalog (database) where the table is located, or null if it is located in the current catalog
schema - The name of the schema where the table is located, or null if is located in the current schema
table - The name of the table
name - The name of the index to be created
columns - The name of the columns in the index
unique - If the index must contain unique values or not
Returns:
The SQL to execute

getDropIndexSql

public String getDropIndexSql(String catalog,
                              String schema,
                              String table,
                              String name,
                              boolean unique)
Generate DROP INDEX <catalog>.<schema>.<table>.<name>.

Parameters:
catalog - The name of the catalog (database) where the table is located, or null if it is located in the current catalog
schema - The name of the schema where the table is located, or null if is located in the current schema
table - The name of the table
name - The name of the index
unique - If the index contains unique values or not
Returns:
The SQL to execute

analyzeAfterBatchOperation

public boolean analyzeAfterBatchOperation()
Return false.


getOptimizeTableSql

public String getOptimizeTableSql(String catalog,
                                  String schema,
                                  String table)
Return null.

Parameters:
catalog - The name of the catalog (database) where the table is located, or null if it is located in the current catalog
schema - The name of the schema where the table is located, or null if is located in the current schema
table - The name of the table to optimize
Returns:
The SQL to execute
See Also:
DbEngine.getAnalyzeTableSql(String, String, String)

getAnalyzeTableSql

public String getAnalyzeTableSql(String catalog,
                                 String schema,
                                 String table)
Return null.

Parameters:
catalog - The name of the catalog (database) where the table is located, or null if it is located in the current catalog
schema - The name of the schema where the table is located, or null if is located in the current schema
table - The name of the table to analyze
Returns:
The SQL to execute, or null if not supported
See Also:
DbEngine.getOptimizeTableSql(String, String, String)

caseInsensitiveComparison

public boolean caseInsensitiveComparison()
Returns TRUE.

Returns:
FALSE if comparisons are case sensitive (ABC != abc), TRUE if they are case insensitive (ABC = abc)
Since:
2.4

getQuotedName

private String getQuotedName(String name)
Put quotes (") around the name.


2.17.2: 2011-06-17