|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.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 |
getCaseSensitiveVarchar(int length)
Return null. |
String |
inspectSchemaGenerationSQL(String sql,
org.hibernate.dialect.Dialect dialect,
boolean update)
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 |
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, getCreateIndexSql, getDropIndexSql, 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 DbEngine
sql
- 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 DbEngine
public boolean supportsColumnAliasInWhere()
supportsColumnAliasInWhere
in interface DbEngine
public boolean supportColumnAliasInOrderBy()
supportColumnAliasInOrderBy
in interface DbEngine
public boolean supportColumnAliasInGroupBy()
supportColumnAliasInGroupBy
in interface DbEngine
public boolean supportColumnAliasInHaving()
supportColumnAliasInHaving
in interface DbEngine
public boolean checkForInvalidNumberOperation()
checkForInvalidNumberOperation
in interface DbEngine
public boolean selectOrderByColumnsIfDistinct()
selectOrderByColumnsIfDistinct
in interface DbEngine
public String ln(String value)
LN(<value>)
.
ln
in interface DbEngine
value
- The value to take the logarithm of
public String abs(String value)
ABS(<value>)
.
abs
in interface DbEngine
value
- The value to use in the calculation
public String exp(String value)
EXP(<value>)
.
exp
in interface DbEngine
value
- The value to use in the calculation
public String power(String base, String exponent)
POWER(<base>, <exponent>)
.
power
in interface DbEngine
base
- The base in the expressionexponent
- The exponent in the expression
public String rlike(String value, String regexp)
<value> = <regexp>
rlike
in interface DbEngine
value
- The left valueregexp
- The regular expression as a string
public boolean isValidTableName(String tableName)
isValidTableName
in interface DbEngine
tableName
- The string to check
public boolean isValidColumnName(String columnName)
isValidColumnName
in interface DbEngine
columnName
- The string to check
public String getCaseSensitiveVarchar(int length)
getCaseSensitiveVarchar
in interface DbEngine
length
- The maximum length that needs to be stored in the column
public String castToDate(String value)
DbEngine
castToDate
in interface DbEngine
value
- The value to cast
public String inspectSchemaGenerationSQL(String sql, org.hibernate.dialect.Dialect dialect, boolean update)
inspectSchemaGenerationSQL
in interface DbEngine
sql
- The original SQL statment as generated by Hibernatedialect
- The Hibernate dialect currently in useupdate
- TRUE if we are updating an existing database,
FALSE if we are creating a new one
protected boolean isValidName(String name)
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |