|
||||||||||
| 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.SAPDBAdapter
public class SAPDBAdapter
Provides methods for adapting SQL language elements to the SAPDB/MaxDB 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 | |
|---|---|
SAPDBAdapter(java.sql.DatabaseMetaData metadata)
Constructs an SAP DB adapter based on the given JDBC metadata. |
|
| Method Summary | |
|---|---|
java.lang.String |
getAddCandidateKeyStatement(CandidateKey ck,
org.jpox.store.mapped.IdentifierFactory factory)
Returns the appropriate SQL to add a candidate key to its table. |
java.lang.String |
getAddForeignKeyStatement(ForeignKey fk,
org.jpox.store.mapped.IdentifierFactory factory)
Returns the appropriate SQL to add a foreign key to its table. |
java.lang.String |
getAddPrimaryKeyStatement(PrimaryKey pk,
org.jpox.store.mapped.IdentifierFactory factory)
Returns the appropriate SQL to add a primary key to its table. |
java.lang.String |
getSelectWithLockOption()
The option to specify in "SELECT ... |
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 |
isBitReallyBoolean()
Accessor for whether a JDBC Types.BIT is really mapped in the datastore to a boolean field. |
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.QueryExpression |
newQueryStatement(org.jpox.store.mapped.DatastoreContainerObject table,
org.jpox.ClassLoaderResolver clr)
Accessor for a new query statement. |
org.jpox.store.mapped.expression.QueryExpression |
newQueryStatement(org.jpox.store.mapped.DatastoreContainerObject table,
org.jpox.store.mapped.DatastoreIdentifier rangeVar,
org.jpox.ClassLoaderResolver clr)
Accessor for a new query statement. |
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)
Returns a new TableExpression object appropriate for this DBMS. |
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 |
supportsAlterTableDropConstraint()
Whether this datastore supports ALTER TABLE DROP constraints |
boolean |
supportsBooleanComparison()
Whether we support Boolean comparisons. |
boolean |
supportsDeferredConstraints()
Whether this datastore supports deferred constraints. |
boolean |
supportsForeignKeyUpdateAction(ForeignKey.FKAction action)
Whether this datastore supports the specified foreign key update action. |
boolean |
supportsLockWithSelectForUpdate()
Whether this datastore supports locking using SELECT ... |
boolean |
supportsSequences()
Whether we support sequences. |
| Methods inherited from class org.jpox.store.mapped.AbstractDatastoreAdapter |
|---|
getAdapterTime, getDatastoreMajorVersion, getDatastoreMinorVersion, getIdentifierQuoteString, getMapping, getMapping, getMapping, getMapping, getMapping, getMappingManager, getMiliseconds, getTime, 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, isReservedKeyword, modOperator, supportsIdentityFields, supportsQueryFetchSize |
| Constructor Detail |
|---|
public SAPDBAdapter(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 isBitReallyBoolean()
isBitReallyBoolean in interface org.jpox.store.mapped.DatastoreAdapterisBitReallyBoolean in class org.jpox.store.mapped.AbstractDatastoreAdapterpublic boolean supportsAlterTableDropConstraint()
DatabaseAdapter
supportsAlterTableDropConstraint in interface RDBMSAdaptersupportsAlterTableDropConstraint in class DatabaseAdapterpublic boolean supportsBooleanComparison()
DatabaseAdapter
supportsBooleanComparison in interface org.jpox.store.mapped.expression.ExpressionSupportedFeaturesAdaptersupportsBooleanComparison in class DatabaseAdapterpublic boolean supportsDeferredConstraints()
DatabaseAdapter
supportsDeferredConstraints in interface RDBMSAdaptersupportsDeferredConstraints in class DatabaseAdapterpublic boolean supportsLockWithSelectForUpdate()
supportsLockWithSelectForUpdate in interface RDBMSAdaptersupportsLockWithSelectForUpdate in class DatabaseAdapterpublic java.lang.String getSelectWithLockOption()
getSelectWithLockOption in interface RDBMSAdaptergetSelectWithLockOption in class DatabaseAdapterpublic boolean supportsForeignKeyUpdateAction(ForeignKey.FKAction action)
supportsForeignKeyUpdateAction in interface RDBMSAdaptersupportsForeignKeyUpdateAction in class DatabaseAdapteraction - The update action
public org.jpox.store.mapped.expression.QueryExpression newQueryStatement(org.jpox.store.mapped.DatastoreContainerObject table,
org.jpox.store.mapped.DatastoreIdentifier rangeVar,
org.jpox.ClassLoaderResolver clr)
DatabaseAdapter
newQueryStatement in interface org.jpox.store.mapped.DatastoreAdapternewQueryStatement in class DatabaseAdaptertable - The table to queryrangeVar - A range variable for the queryclr - The ClassLoaderResolver
public org.jpox.store.mapped.expression.QueryExpression newQueryStatement(org.jpox.store.mapped.DatastoreContainerObject table,
org.jpox.ClassLoaderResolver clr)
DatabaseAdapter
newQueryStatement in interface org.jpox.store.mapped.DatastoreAdapternewQueryStatement in class DatabaseAdaptertable - The table to queryclr - The ClassLoaderResolver
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)
DatabaseAdapter
newTableExpression in interface RDBMSAdapternewTableExpression in class DatabaseAdapterqs - 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.
public java.lang.String getAddPrimaryKeyStatement(PrimaryKey pk,
org.jpox.store.mapped.IdentifierFactory factory)
DatabaseAdapter
ALTER TABLE FOO ADD CONSTRAINT FOO_PK PRIMARY KEY (BAR) ALTER TABLE FOO ADD PRIMARY KEY (BAR)
getAddPrimaryKeyStatement in interface RDBMSAdaptergetAddPrimaryKeyStatement in class DatabaseAdapterpk - An object describing the primary key.factory - Identifier factory
public java.lang.String getAddCandidateKeyStatement(CandidateKey ck,
org.jpox.store.mapped.IdentifierFactory factory)
DatabaseAdapter
ALTER TABLE FOO ADD CONSTRAINT FOO_CK UNIQUE (BAZ) ALTER TABLE FOO ADD UNIQUE (BAZ)
getAddCandidateKeyStatement in interface RDBMSAdaptergetAddCandidateKeyStatement in class DatabaseAdapterck - An object describing the candidate key.factory - Identifier factory
public java.lang.String getAddForeignKeyStatement(ForeignKey fk,
org.jpox.store.mapped.IdentifierFactory factory)
DatabaseAdapter
ALTER TABLE FOO ADD CONSTRAINT FOO_FK1 FOREIGN KEY (BAR, BAZ) REFERENCES ABC (COL1, COL2) ALTER TABLE FOO ADD FOREIGN KEY (BAR, BAZ) REFERENCES ABC (COL1, COL2)
getAddForeignKeyStatement in interface RDBMSAdaptergetAddForeignKeyStatement in class DatabaseAdapterfk - An object describing the foreign key.factory - Identifier factory
public 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 | |||||||||