|
||||||||||
| 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 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 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(java.sql.DatabaseMetaData metadata)
Constructor. |
|
| Method Summary | |
|---|---|
java.lang.String |
cartersianProduct(org.datanucleus.store.mapped.expression.LogicSetExpression Y)
Generates a expression that represents the cartesian product of two sets: X and Y. |
org.datanucleus.store.mapped.expression.ScalarExpression |
concatOperator(org.datanucleus.store.mapped.expression.ScalarExpression operand1,
org.datanucleus.store.mapped.expression.ScalarExpression operand2)
If only one operand expression is of type String, then string conversion is performed on the other operand to produce a string at run time. |
java.lang.String |
getAddColumnStatement(org.datanucleus.store.mapped.DatastoreContainerObject table,
Column col)
Accessor for the SQL statement to add a column to a table. |
java.lang.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. |
java.lang.String |
getAutoIncrementKeyword()
Accessor for the auto-increment keyword for generating DDLs (CREATE TABLEs...). |
java.lang.String |
getAutoIncrementStmt(Table table,
java.lang.String columnName)
Accessor for the auto-increment sql statement for this datastore. |
java.lang.String |
getCreateTableStatement(TableImpl table,
Column[] columns,
java.util.Properties props)
Method to return the CREATE TABLE statement. |
java.lang.String |
getDropTableStatement(org.datanucleus.store.mapped.DatastoreContainerObject table)
Method to return the DROP TABLE statement. |
java.lang.String |
getEscapePatternExpression()
The character for escaping patterns. |
java.lang.String |
getRangeByLimitWhereClause(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. |
java.lang.String |
getSelectNewUUIDStmt()
The function to creates a unique value of type uniqueidentifier. |
java.lang.String |
getVendorID()
|
void |
initialiseTypes(org.datanucleus.store.schema.StoreSchemaHandler handler,
org.datanucleus.ManagedConnection mconn)
Initialise the types for this datastore. |
RDBMSColumnInfo |
newRDBMSColumnInfo(java.sql.ResultSet rs)
Method to create a column info for the current row. |
SQLTypeInfo |
newSQLTypeInfo(java.sql.ResultSet rs)
Create a new SQL type info from the current row of the passed ResultSet. |
org.datanucleus.store.mapped.expression.BooleanExpression |
startsWithMethod(org.datanucleus.store.mapped.expression.ScalarExpression source,
org.datanucleus.store.mapped.expression.ScalarExpression str)
Method to handle the starts with operation. |
org.datanucleus.store.mapped.expression.StringExpression |
toStringExpression(org.datanucleus.store.mapped.expression.NumericExpression expr)
A String conversion that converts a numeric expression to string. |
| 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.0.10-gamma) at http://www.mysql.com/doc/en/Reserved_words.html.
| Constructor Detail |
|---|
public MySQLAdapter(java.sql.DatabaseMetaData metadata)
metadata - MetaData for the DB| Method Detail |
|---|
public void initialiseTypes(org.datanucleus.store.schema.StoreSchemaHandler handler,
org.datanucleus.ManagedConnection mconn)
initialiseTypes in interface org.datanucleus.store.mapped.DatastoreAdapterinitialiseTypes in class DatabaseAdapterhandler - SchemaHandler that we initialise the types formconn - Managed connection to usepublic java.lang.String getVendorID()
getVendorID in interface org.datanucleus.store.mapped.DatastoreAdaptergetVendorID in class DatabaseAdapterpublic RDBMSColumnInfo newRDBMSColumnInfo(java.sql.ResultSet rs)
newRDBMSColumnInfo in interface RDBMSAdapternewRDBMSColumnInfo in class DatabaseAdapterrs - ResultSet from DatabaseMetaData.getColumns()
public SQLTypeInfo newSQLTypeInfo(java.sql.ResultSet rs)
RDBMSAdapter
newSQLTypeInfo in interface RDBMSAdapternewSQLTypeInfo in class DatabaseAdapterrs - ResultSet
public java.lang.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 java.lang.String getCreateTableStatement(TableImpl table,
Column[] columns,
java.util.Properties props)
getCreateTableStatement in interface RDBMSAdaptergetCreateTableStatement in class DatabaseAdaptertable - The tablecolumns - The columns in the tableprops - Properties for controlling the table creation
public java.lang.String getDropTableStatement(org.datanucleus.store.mapped.DatastoreContainerObject table)
getDropTableStatement in interface RDBMSAdaptergetDropTableStatement in class DatabaseAdaptertable - The table
public java.lang.String getAddColumnStatement(org.datanucleus.store.mapped.DatastoreContainerObject table,
Column col)
getAddColumnStatement in interface RDBMSAdaptergetAddColumnStatement in class DatabaseAdaptertable - The tablecol - The column
public java.lang.String getAutoIncrementStmt(Table table,
java.lang.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 java.lang.String getAutoIncrementKeyword()
getAutoIncrementKeyword in interface RDBMSAdaptergetAutoIncrementKeyword in class DatabaseAdapterpublic java.lang.String getSelectNewUUIDStmt()
getSelectNewUUIDStmt in interface RDBMSAdaptergetSelectNewUUIDStmt in class DatabaseAdapter
public java.lang.String getRangeByLimitWhereClause(long offset,
long count)
getRangeByLimitWhereClause in interface RDBMSAdaptergetRangeByLimitWhereClause in class DatabaseAdapteroffset - The offset to return fromcount - The number of items to return
public org.datanucleus.store.mapped.expression.ScalarExpression concatOperator(org.datanucleus.store.mapped.expression.ScalarExpression operand1,
org.datanucleus.store.mapped.expression.ScalarExpression operand2)
If only one operand expression is of type String, then string conversion is performed on the other operand to produce a string at run time. The result is a reference to a String object (newly created, unless the expression is a compile-time constant expression (�15.28))that is the concatenation of the two operand strings. The characters of the left-hand operand precede the characters of the right-hand operand in the newly created string. If an operand of type String is null, then the string "null" is used instead of that operand. "null" is used instead of that operand.
Concatenates two or more character or binary strings, columns, or a combination of strings and column names into one expression (a string operator).
concatOperator in interface org.datanucleus.store.mapped.expression.ExpressionOperatorAdapterconcatOperator in class DatabaseAdapteroperand1 - the left expressionoperand2 - the right expression
public org.datanucleus.store.mapped.expression.BooleanExpression startsWithMethod(org.datanucleus.store.mapped.expression.ScalarExpression source,
org.datanucleus.store.mapped.expression.ScalarExpression str)
startsWithMethod in interface org.datanucleus.store.mapped.expression.ExpressionMethodAdapterstartsWithMethod in class DatabaseAdaptersource - The expression with the searched stringstr - The expression for the search string
public java.lang.String getEscapePatternExpression()
getEscapePatternExpression in interface org.datanucleus.store.mapped.expression.ExpressionPatternAdaptergetEscapePatternExpression in class DatabaseAdapterpublic org.datanucleus.store.mapped.expression.StringExpression toStringExpression(org.datanucleus.store.mapped.expression.NumericExpression expr)
CAST(999999 AS VARCHAR(4000))
toStringExpression in interface org.datanucleus.store.mapped.expression.ExpressionConversionAdaptertoStringExpression in class DatabaseAdapterexpr - The NumericExpression
public java.lang.String cartersianProduct(org.datanucleus.store.mapped.expression.LogicSetExpression Y)
X and Y.
Actually, X is not generated to the expression.
cartersianProduct in interface org.datanucleus.store.mapped.expression.ExpressionLogicSetAdaptercartersianProduct in class DatabaseAdapterY - right hand set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||