|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.triactive.jdo.store.adapter.DatabaseAdapter com.triactive.jdo.store.adapter.MysqlAdapter
Provides methods for adapting SQL language elements to the MySQL database.
Field Summary | |
static java.lang.String |
NONSQL92_RESERVED_WORDS
A string containing the list of MySQL keywords that are not also SQL/92 reserved words, separated by commas. |
Fields inherited from class com.triactive.jdo.store.adapter.DatabaseAdapter |
dbid, identifierQuoteString, keywords, maxCatalogNameLength, maxColumnNameLength, maxConstraintNameLength, maxCorrelationNameLength, maxIndexNameLength, maxSchemaNameLength, maxTableNameLength, storesLowerCaseIdentifiers, storesUpperCaseIdentifiers, supportsCorrelatedSubqueries, supportsGroupByUnrelated, supportsOrderByUnrelated, supportsSubqueriesInExists, supportsSubqueriesInIns, typeMappings, types |
Constructor Summary | |
MysqlAdapter()
|
Method Summary | |
protected void |
adaptTo(DatabaseIdentifier dbid,
java.sql.DatabaseMetaData metadata)
Initializes the database adapter based on the given JDBC metadata. |
SqlExpression |
cast(SqlExpression expr,
java.lang.Class toType)
Returns the appropriate SQL expression for casting an expression to another type. |
boolean |
createIndexesBeforeForeignKeys()
|
java.lang.String |
getDropForeignKeyStatement(BaseTable table,
ConstraintName fkName)
Returns the appropriate SQL to drop a foreign key from its table. |
protected java.lang.String |
getQueryCurrentTimestampStatement()
Returns a statement that will return a timestamp reflecting the database's current date and time. |
ColumnInfo |
newColumnInfo(java.sql.ResultSet rs)
A factory for ColumnInfo objects. |
TypeInfo |
newTypeInfo(java.sql.ResultSet rs,
int row)
A factory for TypeInfo objects. |
boolean |
supportsDeferredConstraints()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String NONSQL92_RESERVED_WORDS
This list was produced based on the reserved word list in the MySQL Manual (Version 4.1).
Constructor Detail |
public MysqlAdapter()
Method Detail |
protected void adaptTo(DatabaseIdentifier dbid, java.sql.DatabaseMetaData metadata) throws java.sql.SQLException
DatabaseAdapter
adaptTo
in class DatabaseAdapter
dbid
- the database identifiermetadata
- the database metadata
java.sql.SQLException
protected java.lang.String getQueryCurrentTimestampStatement()
DatabaseAdapter
getQueryCurrentTimestampStatement
in class DatabaseAdapter
public TypeInfo newTypeInfo(java.sql.ResultSet rs, int row) throws java.sql.SQLException
DatabaseAdapter
ResultSet
object passed must have been
obtained from a call to DatabaseMetaData.getTypeInfo().
The constructor only retrieves the values from the current row; the
caller is required to advance to the next row with ResultSet.next()
.
newTypeInfo
in class DatabaseAdapter
rs
- The result set returned from DatabaseMetaData.getTypeInfo().row
- The current row number in the result set. The first row is 1.
null
if the type indicated by this row should be
excluded from use.
java.sql.SQLException
- If a database error occurs.public ColumnInfo newColumnInfo(java.sql.ResultSet rs) throws java.sql.SQLException
DatabaseAdapter
The column information object is constructed from the current row of the given result set. The result set passed must have been obtained from a call to DatabaseMetaData.getColumns().
The constructor only retrieves the values from the current row; the
caller is required to advance to the next row with ResultSet.next()
.
newColumnInfo
in class DatabaseAdapter
rs
- The result set returned from DatabaseMetaData.getColumns().
java.sql.SQLException
- If a database error occurs.public boolean createIndexesBeforeForeignKeys()
createIndexesBeforeForeignKeys
in class DatabaseAdapter
public boolean supportsDeferredConstraints()
supportsDeferredConstraints
in class DatabaseAdapter
public java.lang.String getDropForeignKeyStatement(BaseTable table, ConstraintName fkName)
DatabaseAdapter
ALTER TABLE FOO DROP CONSTRAINT FOO_FK1
getDropForeignKeyStatement
in class DatabaseAdapter
table
- The table from which to drop the foreign key.fkName
- The name of the foreign key to drop.
public SqlExpression cast(SqlExpression expr, java.lang.Class toType)
DatabaseAdapter
CAST(expr AS type)
cast
in class DatabaseAdapter
expr
- The expression to be cast.toType
- The Java type to cast it to.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |