com.triactive.jdo.store
Class MySQLAdapter
java.lang.Object
com.triactive.jdo.store.DatabaseAdapter
com.triactive.jdo.store.MySQLAdapter
- public class MySQLAdapter
- extends DatabaseAdapter
Provides methods for adapting SQL language elements to the MySQL
database.
- Author:
- Mike Martin
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.DatabaseAdapter |
databaseMajorVersion, databaseMinorVersion, databaseProductName, databaseProductVersion, identifierQuoteString, keywords, maxColumnNameLength, maxConstraintNameLength, maxIndexNameLength, maxTableNameLength, storesLowerCaseIdentifiers, storesUpperCaseIdentifiers, typeMappings, typesByTypeNumber |
Constructor Summary |
MySQLAdapter(java.sql.DatabaseMetaData metadata)
|
Methods inherited from class com.triactive.jdo.store.DatabaseAdapter |
closeConnection, createTypeInfo, getAddCandidateKeyStatement, getAddForeignKeyStatement, getAddPrimaryKeyStatement, getConnection, getCreateIndexStatement, getCreateTableStatement, getDropTableStatement, getDropViewStatement, getIdentifierQuoteString, getInstance, getMapping, getMapping, getMapping, getMappingClass, getMaxColumnNameLength, getMaxConstraintNameLength, getMaxIndexNameLength, getMaxTableNameLength, getSchemaName, getSQLState, getTypeInfo, getTypeInfo, getUnlimitedLengthPrecisionValue, includeOrderByColumnsInSelect, isEmbeddedType, isSQLKeyword, lengthMethod, newColumnInfo, newDataStoreException, newForeignKeyInfo, newQueryStatement, newQueryStatement, parseKeywordList, storesLowerCaseIdentifiers, storesUpperCaseIdentifiers, substringMethod, substringMethod, supportsBooleanComparison, supportsNullsInCandidateKeys, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
NONSQL92_RESERVED_WORDS
public static final 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.
This list is normally obtained dynamically from the driver using
DatabaseMetaData.getSQLKeywords(), but MySQL drivers are known to return
an imcomplete list.
This list was produced based on the reserved word list in the MySQL
Manual (Version 4.0.10-gamma) at http://www.mysql.com/doc/en/Reserved_words.html.
- See Also:
- Constant Field Values
MySQLAdapter
public MySQLAdapter(java.sql.DatabaseMetaData metadata)
getVendorID
public java.lang.String getVendorID()
- Overrides:
getVendorID
in class DatabaseAdapter
newTableExpression
public TableExpression newTableExpression(QueryStatement qs,
Table table,
SQLIdentifier rangeVar)
- Description copied from class:
DatabaseAdapter
- Returns a new TableExpression object appropriate for this DBMS.
This should be an instance of one of the three built-in styles of table
expression:
- TableExprAsJoins
- TableExprAsSubjoins
- TableExprAsSubquery
TableExprAsSubjoins is the default, which arguably produces the most
readable SQL but doesn't work on all DBMS's. TableExprAsSubjoins
should work anywhere, but may be less efficient.
- Overrides:
newTableExpression
in class DatabaseAdapter
- Parameters:
qs
- The query statement in which the table expression will
be included.table
- The main table in the expression.rangeVar
- The SQL alias, or "range variable", to assign to the
expression or to the main table.
newTypeInfo
public TypeInfo newTypeInfo(java.sql.ResultSet rs)
- Description copied from class:
DatabaseAdapter
- A factory for TypeInfo objects. This method should always be used
instead of directly constructing TypeInfo objects in order to give the
DatabaseAdapter an opportunity to modify and/or correct the metadata
obtained from the JDBC driver.
The type information object is constructed from the current row of the
given result set. The
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()
.
- Overrides:
newTypeInfo
in class DatabaseAdapter
- Parameters:
rs
- The result set returned from DatabaseMetaData.getTypeInfo().
- Returns:
- A TypeInfo object constructed from the current result set row, or
null
if the type indicated by this row should be
excluded from use.
createIndexesBeforeForeignKeys
public boolean createIndexesBeforeForeignKeys()
- Overrides:
createIndexesBeforeForeignKeys
in class DatabaseAdapter
supportsAlterTableDropConstraint
public boolean supportsAlterTableDropConstraint()
- Overrides:
supportsAlterTableDropConstraint
in class DatabaseAdapter
supportsDeferredConstraints
public boolean supportsDeferredConstraints()
- Overrides:
supportsDeferredConstraints
in class DatabaseAdapter
Copyright © 2001 TriActive, Inc. All Rights Reserved.