|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.triactive.jdo.store.DatabaseAdapter
com.triactive.jdo.store.SAPDBAdapter
Provides methods for adapting SQL language elements to the SAP DB database.
DatabaseAdapter
Field Summary |
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 | |
protected |
SAPDBAdapter(java.sql.DatabaseMetaData metadata)
Constructs an SAP DB adapter based on the given JDBC metadata. |
Method Summary | |
java.lang.String |
getAddCandidateKeyStatement(SQLIdentifier ckName,
CandidateKey ck)
Returns the appropriate SQL to add a candidate key to its table. |
java.lang.String |
getAddForeignKeyStatement(SQLIdentifier fkName,
ForeignKey fk)
Returns the appropriate SQL to add a foreign key to its table. |
java.lang.String |
getAddPrimaryKeyStatement(SQLIdentifier pkName,
PrimaryKey pk)
Returns the appropriate SQL to add a primary key to its table. |
java.lang.String |
getVendorID()
|
NumericExpression |
lengthMethod(CharacterExpression str)
Returns the appropriate SQL expression for the JDOQL String.length() method. |
TableExpression |
newTableExpression(QueryStatement qs,
Table table,
SQLIdentifier rangeVar)
Returns a new TableExpression object appropriate for this DBMS. |
CharacterExpression |
substringMethod(CharacterExpression str,
NumericExpression begin)
Returns the appropriate SQL expression for the JDOQL String.substring(str,begin) method. |
CharacterExpression |
substringMethod(CharacterExpression str,
NumericExpression begin,
NumericExpression end)
Returns the appropriate SQL expression for the JDOQL String.substring(str,begin,end) method. |
boolean |
supportsAlterTableDropConstraint()
|
boolean |
supportsBooleanComparison()
|
boolean |
supportsDeferredConstraints()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected SAPDBAdapter(java.sql.DatabaseMetaData metadata)
metadata
- the database metadata.Method Detail |
public java.lang.String getVendorID()
getVendorID
in class DatabaseAdapter
public boolean supportsAlterTableDropConstraint()
supportsAlterTableDropConstraint
in class DatabaseAdapter
public boolean supportsBooleanComparison()
supportsBooleanComparison
in class DatabaseAdapter
public boolean supportsDeferredConstraints()
supportsDeferredConstraints
in class DatabaseAdapter
public TableExpression newTableExpression(QueryStatement qs, Table table, SQLIdentifier rangeVar)
DatabaseAdapter
newTableExpression
in class DatabaseAdapter
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.public java.lang.String getAddPrimaryKeyStatement(SQLIdentifier pkName, PrimaryKey pk)
DatabaseAdapter
ALTER TABLE FOO ADD CONSTRAINT FOO_PK PRIMARY KEY (BAR)
getAddPrimaryKeyStatement
in class DatabaseAdapter
pkName
- The name of the primary key to add.pk
- An object describing the primary key.
public java.lang.String getAddCandidateKeyStatement(SQLIdentifier ckName, CandidateKey ck)
DatabaseAdapter
ALTER TABLE FOO ADD CONSTRAINT FOO_CK UNIQUE (BAZ)
getAddCandidateKeyStatement
in class DatabaseAdapter
ckName
- The name of the candidate key to add.ck
- An object describing the candidate key.
public java.lang.String getAddForeignKeyStatement(SQLIdentifier fkName, ForeignKey fk)
DatabaseAdapter
ALTER TABLE FOO ADD CONSTRAINT FOO_FK1 FOREIGN KEY (BAR, BAZ) REFERENCES ABC (COL1, COL2)
getAddForeignKeyStatement
in class DatabaseAdapter
fkName
- The name of the foreign key to add.fk
- An object describing the foreign key.
public NumericExpression lengthMethod(CharacterExpression str)
DatabaseAdapter
CHAR_LENGTH(str)
lengthMethod
in class DatabaseAdapter
str
- The argument to the length() method.
public CharacterExpression substringMethod(CharacterExpression str, NumericExpression begin)
DatabaseAdapter
Note that the value of begin is base 0 (Java-style), while most SQL string functions use base 1.SUBSTRING(str FROM begin)
substringMethod
in class DatabaseAdapter
str
- The first argument to the substring() method.begin
- The second argument to the substring() method.
public CharacterExpression substringMethod(CharacterExpression str, NumericExpression begin, 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 class DatabaseAdapter
str
- The first argument to the substring() method.begin
- The second argument to the substring() method.end
- The third argument to the substring() method.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |