|
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 net.sf.basedb.core.dbengine.MySQLEngine
public class MySQLEngine
Database engine for My SQL.
Constructor Summary | |
---|---|
MySQLEngine()
Create MySQLEngine. |
Method Summary | |
---|---|
boolean |
analyzeAfterBatchOperation()
Return true. |
boolean |
caseInsensitiveComparison()
Returns TRUE. |
String |
getAnalyzeTableSql(String catalog,
String schema,
String table)
Generate ANALYZE TABLE <catalog>. |
String |
getCaseSensitiveVarchar(int length)
Return varchar(length) CHARACTER SET utf8 COLLATE utf8_bin . |
String |
getCreateIndexSql(String catalog,
String schema,
String table,
String name,
Set<String> columns,
boolean unique)
Generate ALTER TABLE <catalog>. |
String |
getDropIndexSql(String catalog,
String schema,
String table,
String name,
boolean unique)
Generate DROP INDEX <name> ON <catalog>. |
String |
getOptimizeTableSql(String catalog,
String schema,
String table)
Generate OPTIMIZE TABLE <catalog>. |
private String |
getQuotedName(String name)
Put quotes (`) around the name. |
String |
ln(String value)
Return LOG(<value>) . |
String |
makeSafeCreateTable(String sql,
String catalog,
String schema,
String table)
Replace CREATE TABLE with CREATE TABLE IF NOT EXISTS... |
String |
rlike(String value,
String regexp)
Return <value> RLIKE <regexp> . |
boolean |
supportColumnAliasInGroupBy()
Returns TRUE. |
boolean |
supportColumnAliasInHaving()
Returns TRUE. |
boolean |
supportColumnAliasInOrderBy()
Returns TRUE. |
boolean |
supportsColumnAliasInWhere()
Returns FALSE. |
boolean |
useThetaJoin()
Always false. |
Methods inherited from class net.sf.basedb.core.dbengine.AbstractDbEngine |
---|
abs, castToDate, checkForInvalidNumberOperation, exp, inspectSchemaGenerationSQL, isValidColumnName, isValidName, isValidTableName, power, selectOrderByColumnsIfDistinct |
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 |
---|
abs, castToDate, checkForInvalidNumberOperation, exp, inspectSchemaGenerationSQL, isValidColumnName, isValidTableName, power, selectOrderByColumnsIfDistinct |
Constructor Detail |
---|
public MySQLEngine()
Method Detail |
---|
public boolean useThetaJoin()
useThetaJoin
in interface DbEngine
useThetaJoin
in class AbstractDbEngine
public String getCreateIndexSql(String catalog, String schema, String table, String name, Set<String> columns, boolean unique)
ALTER TABLE <catalog>.<table> ADD [UNIQUE]
INDEX <name> (<columns>)
.
The schema parameter is not supported.
getCreateIndexSql
in interface 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 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 <name> ON <catalog>.<table>
.
The schema parameter is not supported.
getDropIndexSql
in interface 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 indexunique
- If the index contains unique values or not
public boolean analyzeAfterBatchOperation()
analyzeAfterBatchOperation
in interface DbEngine
public String getOptimizeTableSql(String catalog, String schema, String table)
OPTIMIZE TABLE <catalog>.<table>
.
The schema parameter is not supported.
getOptimizeTableSql
in interface 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 table to optimize
DbEngine.getAnalyzeTableSql(String, String, String)
public String getAnalyzeTableSql(String catalog, String schema, String table)
ANALYZE TABLE <catalog>.<table>
.
The schema parameter is not supported.
getAnalyzeTableSql
in interface 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 table to analyze
DbEngine.getOptimizeTableSql(String, String, String)
public String makeSafeCreateTable(String sql, String catalog, String schema, String table)
makeSafeCreateTable
in interface DbEngine
makeSafeCreateTable
in class AbstractDbEngine
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 caseInsensitiveComparison()
caseInsensitiveComparison
in interface DbEngine
public boolean supportsColumnAliasInWhere()
supportsColumnAliasInWhere
in interface DbEngine
supportsColumnAliasInWhere
in class AbstractDbEngine
public boolean supportColumnAliasInOrderBy()
supportColumnAliasInOrderBy
in interface DbEngine
supportColumnAliasInOrderBy
in class AbstractDbEngine
public boolean supportColumnAliasInGroupBy()
supportColumnAliasInGroupBy
in interface DbEngine
supportColumnAliasInGroupBy
in class AbstractDbEngine
public boolean supportColumnAliasInHaving()
supportColumnAliasInHaving
in interface DbEngine
supportColumnAliasInHaving
in class AbstractDbEngine
public String ln(String value)
LOG(<value>)
.
ln
in interface DbEngine
ln
in class AbstractDbEngine
value
- The value to take the logarithm of
public String rlike(String value, String regexp)
<value> RLIKE <regexp>
.
rlike
in interface DbEngine
rlike
in class AbstractDbEngine
value
- The left valueregexp
- The regular expression as a string
public String getCaseSensitiveVarchar(int length)
varchar(length) CHARACTER SET utf8 COLLATE utf8_bin
.
getCaseSensitiveVarchar
in interface DbEngine
getCaseSensitiveVarchar
in class AbstractDbEngine
length
- The maximum length that needs to be stored in the column
private String getQuotedName(String name)
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |