|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.store.rdbms.adapter.DatabaseAdapter
org.datanucleus.store.rdbms.adapter.MySQLAdapter
public class MySQLAdapter
Provides methods for adapting SQL language elements to the MySQL database.
| Field Summary | |
|---|---|
static 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 org.datanucleus.store.rdbms.adapter.DatabaseAdapter |
|---|
catalogSeparator, datastoreMajorVersion, datastoreMinorVersion, datastoreProductName, datastoreProductVersion, datastoreRevisionVersion, driverMajorVersion, driverMinorVersion, driverName, driverVersion, identifierQuoteString, LOCALISER, LOCALISER_BASE, maxColumnNameLength, maxConstraintNameLength, maxIndexNameLength, maxTableNameLength, properties, reservedKeywords, supportedOptions |
| Fields inherited from interface org.datanucleus.store.mapped.DatastoreAdapter |
|---|
ANALYSIS_METHODS, BIT_IS_REALLY_BOOLEAN, BOOLEAN_COMPARISON, CATALOGS_IN_TABLE_DEFINITIONS, ESCAPE_EXPRESSION_IN_LIKE_PREDICATE, IDENTIFIERS_LOWERCASE, IDENTIFIERS_LOWERCASE_QUOTED, IDENTIFIERS_MIXEDCASE, IDENTIFIERS_MIXEDCASE_QUOTED, IDENTIFIERS_MIXEDCASE_QUOTED_SENSITIVE, IDENTIFIERS_MIXEDCASE_SENSITIVE, IDENTIFIERS_UPPERCASE, IDENTIFIERS_UPPERCASE_QUOTED, IDENTITY_COLUMNS, PROJECTION_IN_TABLE_REFERENCE_JOINS, SCHEMAS_IN_TABLE_DEFINITIONS, SEQUENCES |
| Constructor Summary | |
|---|---|
MySQLAdapter(DatabaseMetaData metadata)
Constructor. |
|
| Method Summary | |
|---|---|
String |
getAddColumnStatement(org.datanucleus.store.mapped.DatastoreContainerObject table,
Column col)
Accessor for the SQL statement to add a column to a table. |
String |
getAddPrimaryKeyStatement(PrimaryKey pk,
org.datanucleus.store.mapped.IdentifierFactory factory)
MySQL, when using AUTO_INCREMENT, requires the primary key specified in the CREATE TABLE, so we do nothing here. |
String |
getAutoIncrementKeyword()
Accessor for the auto-increment keyword for generating DDLs (CREATE TABLEs...). |
String |
getAutoIncrementStmt(Table table,
String columnName)
Accessor for the auto-increment sql statement for this datastore. |
String |
getCreateTableStatement(TableImpl table,
Column[] columns,
Properties props,
org.datanucleus.store.mapped.IdentifierFactory factory)
Method to return the CREATE TABLE statement. |
String |
getDeleteTableStatement(SQLTable tbl)
Method to return the basic SQL for a DELETE TABLE statement. |
String |
getDropTableStatement(org.datanucleus.store.mapped.DatastoreContainerObject table)
Method to return the DROP TABLE statement. |
String |
getEscapePatternExpression()
The character for escaping patterns. |
String |
getRangeByLimitEndOfStatementClause(long offset,
long count)
Method to return the SQL to append to the WHERE clause of a SELECT statement to handle restriction of ranges using the LIMUT keyword. |
String |
getSelectNewUUIDStmt()
The function to creates a unique value of type uniqueidentifier. |
String |
getVendorID()
|
void |
initialiseTypes(org.datanucleus.store.schema.StoreSchemaHandler handler,
org.datanucleus.store.connection.ManagedConnection mconn)
Initialise the types for this datastore. |
RDBMSColumnInfo |
newRDBMSColumnInfo(ResultSet rs)
Method to create a column info for the current row. |
SQLTypeInfo |
newSQLTypeInfo(ResultSet rs)
Create a new SQL type info from the current row of the passed ResultSet. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String NONSQL92_RESERVED_WORDS
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.
| Constructor Detail |
|---|
public MySQLAdapter(DatabaseMetaData metadata)
metadata - MetaData for the DB| Method Detail |
|---|
public void initialiseTypes(org.datanucleus.store.schema.StoreSchemaHandler handler,
org.datanucleus.store.connection.ManagedConnection mconn)
initialiseTypes in interface org.datanucleus.store.mapped.DatastoreAdapterinitialiseTypes in class DatabaseAdapterhandler - SchemaHandler that we initialise the types formconn - Managed connection to usepublic String getVendorID()
getVendorID in interface org.datanucleus.store.mapped.DatastoreAdaptergetVendorID in class DatabaseAdapterpublic RDBMSColumnInfo newRDBMSColumnInfo(ResultSet rs)
newRDBMSColumnInfo in interface RDBMSAdapternewRDBMSColumnInfo in class DatabaseAdapterrs - ResultSet from DatabaseMetaData.getColumns()
public SQLTypeInfo newSQLTypeInfo(ResultSet rs)
RDBMSAdapter
newSQLTypeInfo in interface RDBMSAdapternewSQLTypeInfo in class DatabaseAdapterrs - ResultSet
public String getAddPrimaryKeyStatement(PrimaryKey pk,
org.datanucleus.store.mapped.IdentifierFactory factory)
getAddPrimaryKeyStatement in interface RDBMSAdaptergetAddPrimaryKeyStatement in class DatabaseAdapterpk - An object describing the primary key.factory - Identifier factory
public String getCreateTableStatement(TableImpl table,
Column[] columns,
Properties props,
org.datanucleus.store.mapped.IdentifierFactory factory)
getCreateTableStatement in interface RDBMSAdaptergetCreateTableStatement in class DatabaseAdaptertable - The tablecolumns - The columns in the tableprops - Properties for controlling the table creationfactory - Identifier factory
public String getDropTableStatement(org.datanucleus.store.mapped.DatastoreContainerObject table)
getDropTableStatement in interface RDBMSAdaptergetDropTableStatement in class DatabaseAdaptertable - The table
public String getAddColumnStatement(org.datanucleus.store.mapped.DatastoreContainerObject table,
Column col)
getAddColumnStatement in interface RDBMSAdaptergetAddColumnStatement in class DatabaseAdaptertable - The tablecol - The column
public String getDeleteTableStatement(SQLTable tbl)
DELETE t1 FROM tbl t1. Doesn't include any where clause.
getDeleteTableStatement in interface RDBMSAdaptergetDeleteTableStatement in class DatabaseAdaptertbl - The SQLTable to delete
public String getAutoIncrementStmt(Table table,
String columnName)
getAutoIncrementStmt in interface RDBMSAdaptergetAutoIncrementStmt in class DatabaseAdaptertable - Name of the table that the autoincrement is forcolumnName - Name of the column that the autoincrement is for
public String getAutoIncrementKeyword()
getAutoIncrementKeyword in interface RDBMSAdaptergetAutoIncrementKeyword in class DatabaseAdapterpublic String getSelectNewUUIDStmt()
getSelectNewUUIDStmt in interface RDBMSAdaptergetSelectNewUUIDStmt in class DatabaseAdapter
public String getRangeByLimitEndOfStatementClause(long offset,
long count)
getRangeByLimitEndOfStatementClause in interface RDBMSAdaptergetRangeByLimitEndOfStatementClause in class DatabaseAdapteroffset - The offset to return fromcount - The number of items to return
public String getEscapePatternExpression()
getEscapePatternExpression in class DatabaseAdapter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||