|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jpox.store.mapped.AbstractDatastoreAdapter
org.jpox.store.rdbms.adapter.DatabaseAdapter
org.jpox.store.rdbms.adapter.McKoiAdapter
public class McKoiAdapter
Provides methods for adapting SQL language elements to the McKoi database Server database.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.jpox.store.rdbms.adapter.DatabaseAdapter |
|---|
DatabaseAdapter.JDBCTypeInfo |
| Field Summary |
|---|
| Fields inherited from class org.jpox.store.mapped.AbstractDatastoreAdapter |
|---|
datastoreMajorVersion, datastoreMinorVersion, datastoreProductName, datastoreProductVersion, datastoreRevisionVersion, identifierQuoteString, LOCALISER_BASE, mappingManager, reservedKeywords |
| Constructor Summary | |
|---|---|
McKoiAdapter(java.sql.DatabaseMetaData metadata)
Constructs a Hypersonic SQL adapter based on the given JDBC metadata. |
|
| Method Summary | |
|---|---|
java.lang.String |
getAddColumnStatement(org.jpox.store.mapped.DatastoreContainerObject table,
Column col)
Accessor for the SQL statement to add a column to a table. |
java.sql.Connection |
getConnection(ConnectionProvider connProvider,
javax.sql.DataSource[] ds,
int isolationLevel)
Accessor for a Connection to the datastore. |
java.lang.String |
getDropTableStatement(org.jpox.store.mapped.DatastoreContainerObject table)
Returns the appropriate SQL to drop the given table. |
int |
getMaxColumnNameLength()
Accessor for the maximum column name length permitted on this datastore. |
int |
getMaxConstraintNameLength()
Accessor for the maximum constraint name length permitted on this datastore. |
int |
getMaxIndexNameLength()
Accessor for the maximum index name length permitted on this datastore. |
int |
getMaxTableNameLength()
Accessor for the maximum table name length permitted on this datastore. |
java.lang.String |
getSequenceCreateStmt(java.lang.String sequence_name,
java.lang.String min,
java.lang.String max,
java.lang.String start,
java.lang.String increment,
java.lang.String cache_size)
Accessor for the sequence statement to create the sequence. |
java.lang.String |
getSequenceNextStmt(java.lang.String sequence_name)
Accessor for the statement for getting the next id from the sequence for this datastore. |
java.lang.String |
getVendorID()
|
boolean |
isSQLKeyword(java.lang.String word)
Tests if a given string is a SQL key word. |
org.jpox.store.mapped.expression.NumericExpression |
lengthMethod(org.jpox.store.mapped.expression.StringExpression str)
Returns the appropriate SQL expression for the JDOQL String.length() method. |
org.jpox.store.mapped.expression.LogicSetExpression |
newTableExpression(org.jpox.store.mapped.expression.QueryExpression qs,
org.jpox.store.mapped.DatastoreContainerObject table,
org.jpox.store.mapped.DatastoreIdentifier rangeVar)
Return a new TableExpression appropriate to MySQL. |
TypeInfo |
newTypeInfo(java.sql.ResultSet rs)
Factory for TypeInfo objects. |
org.jpox.store.mapped.expression.StringExpression |
substringMethod(org.jpox.store.mapped.expression.StringExpression str,
org.jpox.store.mapped.expression.NumericExpression begin)
Returns the appropriate SQL expression for the JDOQL String.substring(str,begin) method. |
org.jpox.store.mapped.expression.StringExpression |
substringMethod(org.jpox.store.mapped.expression.StringExpression str,
org.jpox.store.mapped.expression.NumericExpression begin,
org.jpox.store.mapped.expression.NumericExpression end)
Returns the appropriate SQL expression for the JDOQL String.substring(str,begin,end) method. |
boolean |
supportsEscapeExpressionInLikePredicate()
Whether this datastore supports the use of the escape expression in like predicates |
boolean |
supportsSequences()
Whether we support sequences. |
boolean |
supportsTransactionIsolationLevel(int isolationLevel)
Accessor for whether the adapter supports the transaction isolation level |
boolean |
useUnionAll()
Union combines the results of two or more queries into a single result set. |
| Methods inherited from class org.jpox.store.mapped.AbstractDatastoreAdapter |
|---|
getAdapterTime, getDatastoreMajorVersion, getDatastoreMinorVersion, getIdentifierQuoteString, getMapping, getMapping, getMapping, getMapping, getMapping, getMappingManager, getMiliseconds, getTime, isBitReallyBoolean, isReservedKeyword, modOperator, supportsIdentityFields, supportsQueryFetchSize |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.jpox.store.rdbms.adapter.RDBMSAdapter |
|---|
getIdentifierQuoteString |
| Methods inherited from interface org.jpox.store.mapped.DatastoreAdapter |
|---|
getAdapterTime, getDatastoreMajorVersion, getDatastoreMinorVersion, getMapping, getMapping, getMapping, getMapping, getMappingManager, isBitReallyBoolean, isReservedKeyword, modOperator, supportsIdentityFields, supportsQueryFetchSize |
| Constructor Detail |
|---|
public McKoiAdapter(java.sql.DatabaseMetaData metadata)
metadata - the database metadata.| Method Detail |
|---|
public java.lang.String getVendorID()
getVendorID in interface org.jpox.store.mapped.DatastoreAdaptergetVendorID in class org.jpox.store.mapped.AbstractDatastoreAdapterpublic boolean isSQLKeyword(java.lang.String word)
DatabaseAdapter
The list of key words tested against is defined to contain all SQL/92 key
words, plus any additional key words reported by the JDBC driver for this
adapter via DatabaseMetaData.getSQLKeywords().
In general, use of a SQL key word as an identifier should be avoided. SQL/92 key words are divided into reserved and non-reserved words. If a reserved word is used as an identifier it must be quoted with double quotes. Strictly speaking, the same is not true of non-reserved words. However, as C.J. Date writes in A Guide To The SQL Standard :
The rule by which it is determined within the standard that one key word needs to be reserved while another need not is not clear to this writer. In practice, it is probably wise to treat all key words as reserved.
isSQLKeyword in interface RDBMSAdapterisSQLKeyword in class DatabaseAdapterword - The word to test.
true if word is a SQL key word for
this DBMS. The comparison is case-insensitive.SQLConstantspublic int getMaxTableNameLength()
getMaxTableNameLength in interface RDBMSAdaptergetMaxTableNameLength in class DatabaseAdapterpublic int getMaxConstraintNameLength()
getMaxConstraintNameLength in interface RDBMSAdaptergetMaxConstraintNameLength in class DatabaseAdapterpublic int getMaxIndexNameLength()
getMaxIndexNameLength in interface RDBMSAdaptergetMaxIndexNameLength in class DatabaseAdapterpublic int getMaxColumnNameLength()
getMaxColumnNameLength in interface RDBMSAdaptergetMaxColumnNameLength in class DatabaseAdapter
public java.lang.String getAddColumnStatement(org.jpox.store.mapped.DatastoreContainerObject table,
Column col)
getAddColumnStatement in interface RDBMSAdaptergetAddColumnStatement in class DatabaseAdaptertable - The tablecol - The column
public TypeInfo newTypeInfo(java.sql.ResultSet rs)
newTypeInfo in class DatabaseAdapterrs - The ResultSet from DatabaseMetaData.getTypeInfo().
public boolean supportsEscapeExpressionInLikePredicate()
supportsEscapeExpressionInLikePredicate in interface org.jpox.store.mapped.expression.ExpressionSupportedFeaturesAdaptersupportsEscapeExpressionInLikePredicate in class DatabaseAdapterpublic boolean supportsTransactionIsolationLevel(int isolationLevel)
supportsTransactionIsolationLevel in interface RDBMSAdaptersupportsTransactionIsolationLevel in class DatabaseAdapterisolationLevel - the isolation level
public java.sql.Connection getConnection(ConnectionProvider connProvider,
javax.sql.DataSource[] ds,
int isolationLevel)
throws java.sql.SQLException
getConnection in interface RDBMSAdaptergetConnection in class DatabaseAdapterconnProvider - the ConnectionProviderds - The data source. Possible to have more than one datasource for failoverisolationLevel - The level of transaction isolation
java.sql.SQLException - Thrown when an error occurs in the creation.
Up to and including 1.0.2, McKoi supports only Connection.TRANSACTION_SERIALIZABLE.public java.lang.String getDropTableStatement(org.jpox.store.mapped.DatastoreContainerObject table)
DROP TABLE FOO
getDropTableStatement in interface RDBMSAdaptergetDropTableStatement in class DatabaseAdaptertable - The table to drop.
public org.jpox.store.mapped.expression.LogicSetExpression newTableExpression(org.jpox.store.mapped.expression.QueryExpression qs,
org.jpox.store.mapped.DatastoreContainerObject table,
org.jpox.store.mapped.DatastoreIdentifier rangeVar)
newTableExpression in interface RDBMSAdapternewTableExpression in class DatabaseAdapterqs - The QueryStatement to add the expression totable - The table in the expressionrangeVar - range variable to assign to the expression.
public boolean useUnionAll()
useUnionAll in interface RDBMSAdapteruseUnionAll in class DatabaseAdapterpublic org.jpox.store.mapped.expression.NumericExpression lengthMethod(org.jpox.store.mapped.expression.StringExpression str)
DatabaseAdapter
CHAR_LENGTH(str)
lengthMethod in interface org.jpox.store.mapped.expression.ExpressionMethodAdapterlengthMethod in class DatabaseAdapterstr - The argument to the length() method.
public org.jpox.store.mapped.expression.StringExpression substringMethod(org.jpox.store.mapped.expression.StringExpression str,
org.jpox.store.mapped.expression.NumericExpression begin)
DatabaseAdapter
SUBSTRING(str FROM begin)Note that the value of begin is base 0(Java-style), while most SQL string functions use base 1.
substringMethod in interface org.jpox.store.mapped.expression.ExpressionMethodAdaptersubstringMethod in class DatabaseAdapterstr - The first argument to the substring() method.begin - The second argument to the substring() method.
public org.jpox.store.mapped.expression.StringExpression substringMethod(org.jpox.store.mapped.expression.StringExpression str,
org.jpox.store.mapped.expression.NumericExpression begin,
org.jpox.store.mapped.expression.NumericExpression end)
DatabaseAdapter
Note that the value of begin is base 0 (Java-style), while most SQL string functions use base 1. Note also that an end position is given, while most SQL substring functions take a length.SUBSTRING(str FROM begin FOR len)
substringMethod in interface org.jpox.store.mapped.expression.ExpressionMethodAdaptersubstringMethod in class DatabaseAdapterstr - The first argument to the substring() method.begin - The second argument to the substring() method.end - The third argument to the substring() method.
public boolean supportsSequences()
supportsSequences in interface org.jpox.store.mapped.DatastoreAdaptersupportsSequences in interface RDBMSAdaptersupportsSequences in class org.jpox.store.mapped.AbstractDatastoreAdapter
public java.lang.String getSequenceCreateStmt(java.lang.String sequence_name,
java.lang.String min,
java.lang.String max,
java.lang.String start,
java.lang.String increment,
java.lang.String cache_size)
getSequenceCreateStmt in interface RDBMSAdaptergetSequenceCreateStmt in class DatabaseAdaptersequence_name - Name of the sequencemin - Minimum value for the sequencemax - Maximum value for the sequencestart - Start value for the sequenceincrement - Increment value for the sequencecache_size - Cache size for the sequence
public java.lang.String getSequenceNextStmt(java.lang.String sequence_name)
getSequenceNextStmt in interface RDBMSAdaptergetSequenceNextStmt in class DatabaseAdaptersequence_name - Name of the sequence
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||