|
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
public abstract class AbstractDbEngine
An abstract superclass with default implementations for most DbEngine
methods. Subclasses only needs to override methods which behave differently.
| Field Summary | |
|---|---|
private static Pattern |
valid
A regexp checking for invalid characters. |
| Constructor Summary | |
|---|---|
AbstractDbEngine()
Create AbstractDbEngine. |
|
| Method Summary | |
|---|---|
String |
abs(String value)
Return ABS(<value>). |
String |
castToDate(String value)
Get a function that casts a date/timestamp to a date (eg. no time should be included in the result). |
boolean |
checkForInvalidNumberOperation()
Returns FALSE. |
String |
exp(String value)
Return EXP(<value>). |
String |
getApproximateRowCountSql(String catalog,
String schema,
String table)
Get an SQL statement that returns an approximate count for the number of rows in the given table. |
String |
getCaseSensitiveVarchar(int length)
Return null. |
String |
getQuotedName(String name)
Put quotes (") around the name. |
String |
inspectSchemaGenerationSQL(String sql,
Dialect dialect,
SchemaGenerator.Mode mode)
Remove "not null" constraints from "alter table ... add column" statements that doesn't supply a default value for the new column when updating. |
boolean |
isValidColumnName(String columnName)
Checks that the name only contains the following characters: a-zA-Z0-9_ It must also start with a letter or underscore. |
protected boolean |
isValidName(String name)
Check that the name only contains a-zA-Z0-9_ and starts with a letter or underscore. |
boolean |
isValidTableName(String tableName)
Checks that the name only contains the following characters: a-zA-Z0-9_ It must also start with a letter or underscore. |
String |
ln(String value)
Return LN(<value>). |
String |
makeSafeCreateTable(String sql,
String catalog,
String schema,
String table)
Return the SQL unmodified. |
String |
power(String base,
String exponent)
Return POWER(<base>, <exponent>). |
String |
rlike(String value,
String regexp)
Return <value> = <regexp> |
boolean |
selectOrderByColumnsIfDistinct()
Returns FALSE. |
boolean |
supportColumnAliasInGroupBy()
Returns FALSE. |
boolean |
supportColumnAliasInHaving()
Returns FALSE. |
boolean |
supportColumnAliasInOrderBy()
Returns FALSE. |
boolean |
supportsColumnAliasInWhere()
Returns FALSE. |
boolean |
useSavePointToContinueTransactionFromSqlFailure()
If the underlying database need to create a savepoint before executing an SQL statement that results in an error in order to be able to continue using the same transaction for other SQL queries. |
boolean |
useThetaJoin()
Most databases doesn't. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.sf.basedb.core.dbengine.DbEngine |
|---|
analyzeAfterBatchOperation, caseInsensitiveComparison, getAnalyzeTableSql, getCreateForeignKeySql, getCreateIndexSql, getCreatePrimaryKeySql, getDropForeignKeySql, getDropIndexSql, getDropPrimaryKey, getInsertAutoIncrementSql, getOptimizeTableSql |
| Field Detail |
|---|
private static final Pattern valid
| Constructor Detail |
|---|
public AbstractDbEngine()
| Method Detail |
|---|
public String makeSafeCreateTable(String sql,
String catalog,
String schema,
String table)
makeSafeCreateTable in interface DbEnginesql - The original SQLcatalog - The name of the catalog (database) where the table is
being create, or null if it is located in the current catalogschema - The name of the schema where the table is being created, or
null if is located in the current schematable - The name of the table that is being created
public boolean useThetaJoin()
useThetaJoin in interface DbEnginepublic boolean supportsColumnAliasInWhere()
supportsColumnAliasInWhere in interface DbEnginepublic boolean supportColumnAliasInOrderBy()
supportColumnAliasInOrderBy in interface DbEnginepublic boolean supportColumnAliasInGroupBy()
supportColumnAliasInGroupBy in interface DbEnginepublic boolean supportColumnAliasInHaving()
supportColumnAliasInHaving in interface DbEnginepublic boolean checkForInvalidNumberOperation()
checkForInvalidNumberOperation in interface DbEnginepublic boolean selectOrderByColumnsIfDistinct()
selectOrderByColumnsIfDistinct in interface DbEnginepublic String ln(String value)
LN(<value>).
ln in interface DbEnginevalue - The value to take the logarithm of
public String abs(String value)
ABS(<value>).
abs in interface DbEnginevalue - The value to use in the calculation
public String exp(String value)
EXP(<value>).
exp in interface DbEnginevalue - The value to use in the calculation
public String power(String base,
String exponent)
POWER(<base>, <exponent>).
power in interface DbEnginebase - The base in the expressionexponent - The exponent in the expression
public String rlike(String value,
String regexp)
<value> = <regexp>
rlike in interface DbEnginevalue - The left valueregexp - The regular expression as a string
public boolean isValidTableName(String tableName)
isValidTableName in interface DbEnginetableName - The string to check
public boolean isValidColumnName(String columnName)
isValidColumnName in interface DbEnginecolumnName - The string to check
public String getCaseSensitiveVarchar(int length)
getCaseSensitiveVarchar in interface DbEnginelength - The maximum length that needs to be stored in the column
public String castToDate(String value)
DbEngine
castToDate in interface DbEnginevalue - The value to cast
public String inspectSchemaGenerationSQL(String sql,
Dialect dialect,
SchemaGenerator.Mode mode)
inspectSchemaGenerationSQL in interface DbEnginesql - The original SQL statment as generated by Hibernatedialect - The Hibernate dialect currently in usemode - The installation mode
public String getQuotedName(String name)
getQuotedName in interface DbEnginename - The name of an object in the database
public boolean useSavePointToContinueTransactionFromSqlFailure()
DbEngine
useSavePointToContinueTransactionFromSqlFailure in interface DbEngine
public String getApproximateRowCountSql(String catalog,
String schema,
String table)
DbEngine
getApproximateRowCountSql in interface DbEnginecatalog - 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
protected boolean isValidName(String name)
|
3.1.1: 2012-03-29 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||