|
||||||||||
| 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.OracleAdapter
public class OracleAdapter
Provides methods for adapting SQL language elements to the Oracle database.
DatabaseAdapter| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.jpox.store.rdbms.adapter.DatabaseAdapter |
|---|
DatabaseAdapter.JDBCTypeInfo |
| Field Summary | |
|---|---|
static java.lang.String |
ORACLE_10_RESERVED_WORDS
A string containing the list of Oracle keywords This list is normally obtained dynamically from the driver using DatabaseMetaData.getSQLKeywords() Based on database Oracle10g |
static java.lang.String |
ORACLE_8_RESERVED_WORDS
A string containing the list of Oracle keywords This list is normally obtained dynamically from the driver using DatabaseMetaData.getSQLKeywords() Based on database Oracle8 |
static java.lang.String |
ORACLE_9_RESERVED_WORDS
A string containing the list of Oracle keywords This list is normally obtained dynamically from the driver using DatabaseMetaData.getSQLKeywords() Based on database Oracle9i |
| Fields inherited from class org.jpox.store.mapped.AbstractDatastoreAdapter |
|---|
datastoreMajorVersion, datastoreMinorVersion, datastoreProductName, datastoreProductVersion, datastoreRevisionVersion, identifierQuoteString, LOCALISER_BASE, mappingManager, reservedKeywords |
| Constructor Summary | |
|---|---|
OracleAdapter(java.sql.DatabaseMetaData metadata)
Constructs an Oracle adapter based on the given JDBC metadata. |
|
| Method Summary | |
|---|---|
java.lang.String |
getCatalogName(java.sql.Connection conn)
Accessor for the Catalog Name for this datastore. |
java.sql.ResultSet |
getColumns(java.sql.Connection conn,
java.lang.String catalog,
java.lang.String schema,
java.lang.String table)
Accessor for table and column information for a catalog/schema in this datastore. |
java.lang.String |
getDatastoreDateStatement()
Accessor for a statement that will return the statement to use to get the datastore date. |
org.jpox.store.mapped.expression.NumericExpression |
getDayMethod(org.jpox.store.mapped.expression.SqlTemporalExpression date)
Returns the appropriate SQL expression for the JDOQL Date.getDay() method. |
java.lang.String |
getDropTableStatement(org.jpox.store.mapped.DatastoreContainerObject table)
Method to return the drop table statement for Oracle. |
java.sql.ResultSet |
getExistingIndexes(java.sql.Connection conn,
java.sql.DatabaseMetaData dmd,
java.lang.String catalog,
java.lang.String schema,
java.lang.String table)
Provide the existing indexes in the database for the table |
org.jpox.store.mapped.expression.NumericExpression |
getHourMethod(org.jpox.store.mapped.expression.SqlTemporalExpression time)
Returns the appropriate SQL expression for the JDOQL Time.getHour() method. |
org.jpox.store.mapped.expression.NumericExpression |
getMinuteMethod(org.jpox.store.mapped.expression.SqlTemporalExpression time)
Returns the appropriate SQL expression for the JDOQL Time.getMinute() method. |
org.jpox.store.mapped.expression.NumericExpression |
getMonthMethod(org.jpox.store.mapped.expression.SqlTemporalExpression date)
Returns the appropriate SQL expression for the JDOQL Date.getMonth() method. |
org.jpox.store.mapped.mapping.MappingManager |
getNewMappingManager()
Acessor for a new MappingManager |
java.lang.String |
getNonAnsiInnerJoinWhereClause(java.lang.String col1,
java.lang.String col2)
Accessor for the WHERE clause to add to provide an INNER JOIN using non-ANSI syntax. |
java.lang.String |
getNonAnsiLeftOuterJoinWhereClause(java.lang.String col1,
java.lang.String col2)
Accessor for the WHERE clause to add to provide a LEFT OUTER JOIN using non-ANSI syntax. |
java.lang.String |
getNonAnsiRightOuterJoinWhereClause(java.lang.String col1,
java.lang.String col2)
Accessor for the WHERE clause to add to provide a LEFT OUTER JOIN using non-ANSI syntax. |
java.lang.String |
getSchemaName(java.sql.Connection conn)
Accessor for the Schema Name for this datastore. |
org.jpox.store.mapped.expression.NumericExpression |
getSecondMethod(org.jpox.store.mapped.expression.SqlTemporalExpression time)
Returns the appropriate SQL expression for the JDOQL Time.getSecond() method. |
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 |
getSurrogateForEmptyStrings()
Some databases, Oracle, treats an empty string (0 length) equals null |
int |
getTransactionIsolationForSchemaCreation()
Accessor for the transaction isolation level to use during schema creation. |
java.lang.String |
getVendorID()
Accessor for the vendor id |
org.jpox.store.mapped.expression.NumericExpression |
getYearMethod(org.jpox.store.mapped.expression.SqlTemporalExpression date)
Returns the appropriate SQL expression for the JDOQL Date.getYear() method. |
org.jpox.store.mapped.expression.NumericExpression |
indexOfMethod(org.jpox.store.mapped.expression.ScalarExpression source,
org.jpox.store.mapped.expression.ScalarExpression str,
org.jpox.store.mapped.expression.NumericExpression from)
Returns the appropriate SQL expression for the JDOQL String.indexOf() method. |
boolean |
isNullEqualsEmptyStrings()
Some databases, Oracle, treats an empty string (0 length) equals null |
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.NumericExpression |
modOperator(org.jpox.store.mapped.expression.ScalarExpression operand1,
org.jpox.store.mapped.expression.ScalarExpression operand2)
Method to generate a modulus expression. |
ColumnInfo |
newColumnInfo(java.sql.ResultSet rs)
Accessor for ColumnInfo |
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. |
boolean |
requiresColumnDefaultsInitialising()
Whether to initialise the column default values for this datastore. |
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 |
supportsAnsiJoinSyntax()
Accessor for whether the RDBMS supports ANSI join syntax. |
boolean |
supportsBooleanComparison()
Whether we support Boolean comparisons. |
boolean |
supportsForeignKeyDeleteAction(ForeignKey.FKAction action)
Whether this datastore supports the specified foreign key delete action |
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, isBitReallyBoolean, isReservedKeyword, 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, supportsIdentityFields, supportsQueryFetchSize |
| Field Detail |
|---|
public static final java.lang.String ORACLE_8_RESERVED_WORDS
public static final java.lang.String ORACLE_9_RESERVED_WORDS
public static final java.lang.String ORACLE_10_RESERVED_WORDS
| Constructor Detail |
|---|
public OracleAdapter(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 isNullEqualsEmptyStrings()
isNullEqualsEmptyStrings in interface RDBMSAdapterisNullEqualsEmptyStrings in class DatabaseAdapterpublic java.lang.String getSurrogateForEmptyStrings()
getSurrogateForEmptyStrings in interface RDBMSAdaptergetSurrogateForEmptyStrings in class DatabaseAdapter
public java.lang.String getCatalogName(java.sql.Connection conn)
throws java.sql.SQLException
DatabaseAdapter
getCatalogName in interface RDBMSAdaptergetCatalogName in class DatabaseAdapterconn - Connection to the datastore
java.sql.SQLException - Thrown if error occurs in determining the
catalog name.
public java.lang.String getSchemaName(java.sql.Connection conn)
throws java.sql.SQLException
DatabaseAdapter
getSchemaName in interface RDBMSAdaptergetSchemaName in class DatabaseAdapterconn - Connection to the datastore
java.sql.SQLException - Thrown if error occurs in determining the
schema name.public boolean supportsLockWithSelectForUpdate()
supportsLockWithSelectForUpdate in interface RDBMSAdaptersupportsLockWithSelectForUpdate in class DatabaseAdapterpublic boolean supportsForeignKeyDeleteAction(ForeignKey.FKAction action)
supportsForeignKeyDeleteAction in interface RDBMSAdaptersupportsForeignKeyDeleteAction in class DatabaseAdapteraction - The delete action
public boolean supportsForeignKeyUpdateAction(ForeignKey.FKAction action)
supportsForeignKeyUpdateAction in interface RDBMSAdaptersupportsForeignKeyUpdateAction in class DatabaseAdapteraction - The update action
public boolean supportsBooleanComparison()
DatabaseAdapter
supportsBooleanComparison in interface org.jpox.store.mapped.expression.ExpressionSupportedFeaturesAdaptersupportsBooleanComparison in class DatabaseAdapterpublic boolean supportsAnsiJoinSyntax()
supportsAnsiJoinSyntax in interface RDBMSAdaptersupportsAnsiJoinSyntax in class DatabaseAdapter
public java.lang.String getNonAnsiInnerJoinWhereClause(java.lang.String col1,
java.lang.String col2)
getNonAnsiInnerJoinWhereClause in interface RDBMSAdaptergetNonAnsiInnerJoinWhereClause in class DatabaseAdaptercol1 - The main datastore columncol2 - The secondary column to join to
public java.lang.String getNonAnsiLeftOuterJoinWhereClause(java.lang.String col1,
java.lang.String col2)
getNonAnsiLeftOuterJoinWhereClause in interface RDBMSAdaptergetNonAnsiLeftOuterJoinWhereClause in class DatabaseAdaptercol1 - The main datastore columncol2 - The secondary column to join to
public java.lang.String getNonAnsiRightOuterJoinWhereClause(java.lang.String col1,
java.lang.String col2)
getNonAnsiRightOuterJoinWhereClause in class DatabaseAdaptercol1 - The main datastore columncol2 - The secondary column to join to
public java.sql.ResultSet getExistingIndexes(java.sql.Connection conn,
java.sql.DatabaseMetaData dmd,
java.lang.String catalog,
java.lang.String schema,
java.lang.String table)
throws java.sql.SQLException
getExistingIndexes in interface RDBMSAdaptergetExistingIndexes in class DatabaseAdapterconn - the JDBC connectiondmd - the DatabaseMetaDatacatalog - the catalog nameschema - the schema nametable - the table name
java.sql.SQLException
public org.jpox.store.mapped.expression.QueryExpression newQueryStatement(org.jpox.store.mapped.DatastoreContainerObject table,
org.jpox.ClassLoaderResolver clr)
newQueryStatement in interface org.jpox.store.mapped.DatastoreAdapternewQueryStatement in class DatabaseAdaptertable - The table to queryclr - The ClassLoaderResolver
public org.jpox.store.mapped.expression.QueryExpression newQueryStatement(org.jpox.store.mapped.DatastoreContainerObject table,
org.jpox.store.mapped.DatastoreIdentifier rangeVar,
org.jpox.ClassLoaderResolver clr)
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.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 getDropTableStatement(org.jpox.store.mapped.DatastoreContainerObject table)
getDropTableStatement in interface RDBMSAdaptergetDropTableStatement in class DatabaseAdaptertable - The table
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 org.jpox.store.mapped.expression.NumericExpression modOperator(org.jpox.store.mapped.expression.ScalarExpression operand1,
org.jpox.store.mapped.expression.ScalarExpression operand2)
modOperator in interface org.jpox.store.mapped.DatastoreAdaptermodOperator in interface org.jpox.store.mapped.expression.ExpressionOperatorAdaptermodOperator in class org.jpox.store.mapped.AbstractDatastoreAdapteroperand1 - the left expressionoperand2 - the right expression
public org.jpox.store.mapped.expression.NumericExpression getDayMethod(org.jpox.store.mapped.expression.SqlTemporalExpression date)
TO_NUMBER(TO_CHAR(date,'DD'))
getDayMethod in interface org.jpox.store.mapped.expression.ExpressionMethodAdaptergetDayMethod in class DatabaseAdapterdate - The date for the getDay() method.
public org.jpox.store.mapped.expression.NumericExpression getMonthMethod(org.jpox.store.mapped.expression.SqlTemporalExpression date)
TO_NUMBER(TO_CHAR(date,'MM'))
getMonthMethod in interface org.jpox.store.mapped.expression.ExpressionMethodAdaptergetMonthMethod in class DatabaseAdapterdate - The date for the getMonth() method.
public org.jpox.store.mapped.expression.NumericExpression getYearMethod(org.jpox.store.mapped.expression.SqlTemporalExpression date)
TO_NUMBER(TO_CHAR(date,'YYYY'))
getYearMethod in interface org.jpox.store.mapped.expression.ExpressionMethodAdaptergetYearMethod in class DatabaseAdapterdate - The date for the getYear() method.
public org.jpox.store.mapped.expression.NumericExpression getHourMethod(org.jpox.store.mapped.expression.SqlTemporalExpression time)
TO_NUMBER(TO_CHAR(time,'HH24'))
getHourMethod in interface org.jpox.store.mapped.expression.ExpressionMethodAdaptergetHourMethod in class DatabaseAdaptertime - The time for the getHour() method.
public org.jpox.store.mapped.expression.NumericExpression getMinuteMethod(org.jpox.store.mapped.expression.SqlTemporalExpression time)
TO_NUMBER(TO_CHAR(time,'MI'))
getMinuteMethod in interface org.jpox.store.mapped.expression.ExpressionMethodAdaptergetMinuteMethod in class DatabaseAdaptertime - The time for the getMinute() method.
public org.jpox.store.mapped.expression.NumericExpression getSecondMethod(org.jpox.store.mapped.expression.SqlTemporalExpression time)
TO_NUMBER(TO_CHAR(time,'SS'))
getSecondMethod in interface org.jpox.store.mapped.expression.ExpressionMethodAdaptergetSecondMethod in class DatabaseAdaptertime - The time for the getSecond() method.
public org.jpox.store.mapped.expression.NumericExpression indexOfMethod(org.jpox.store.mapped.expression.ScalarExpression source,
org.jpox.store.mapped.expression.ScalarExpression str,
org.jpox.store.mapped.expression.NumericExpression from)
since INSTR returns the first character as position 1. Similarly the "pos" is based on the first position being 1.INSTR(str, substr [,pos])-1
indexOfMethod in interface org.jpox.store.mapped.expression.ExpressionMethodAdapterindexOfMethod in class DatabaseAdaptersource - The expression we want to search.str - The argument to the indexOf() method.from - The from position
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
public ColumnInfo newColumnInfo(java.sql.ResultSet rs)
newColumnInfo in interface RDBMSAdapternewColumnInfo in class DatabaseAdapterrs - The result set returned from DatabaseMetaData.getColumns().
DatabaseAdapter.newColumnInfo(java.sql.ResultSet)public int getTransactionIsolationForSchemaCreation()
getTransactionIsolationForSchemaCreation in interface RDBMSAdaptergetTransactionIsolationForSchemaCreation in class DatabaseAdapterpublic boolean requiresColumnDefaultsInitialising()
requiresColumnDefaultsInitialising in interface RDBMSAdapterrequiresColumnDefaultsInitialising in class DatabaseAdapter
public java.sql.ResultSet getColumns(java.sql.Connection conn,
java.lang.String catalog,
java.lang.String schema,
java.lang.String table)
throws java.sql.SQLException
getColumns in interface RDBMSAdaptergetColumns in class DatabaseAdapterconn - Connection to usecatalog - The catalog (null if none)schema - The schema (null if none)table - The table (null if all)
java.sql.SQLException - Thrown if an error occurspublic org.jpox.store.mapped.mapping.MappingManager getNewMappingManager()
getNewMappingManager in class DatabaseAdapterpublic java.lang.String getDatastoreDateStatement()
getDatastoreDateStatement in interface RDBMSAdaptergetDatastoreDateStatement in class DatabaseAdapter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||