Package org.apache.cayenne.dba.oracle
Class OracleAdapter
java.lang.Object
org.apache.cayenne.dba.JdbcAdapter
org.apache.cayenne.dba.oracle.OracleAdapter
- All Implemented Interfaces:
DbAdapter
DbAdapter implementation for Oracle RDBMS
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static booleanstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected static intprotected static booleanstatic final StringFields inherited from class org.apache.cayenne.dba.JdbcAdapter
caseInsensitiveCollations, defaultCharColumnLength, ejbqlTranslator, extendedTypes, logger, nativeColumnTypes, quotingStrategy, supportsBatchUpdates, supportsGeneratedKeys, supportsUniqueConstraints -
Constructor Summary
ConstructorsConstructorDescriptionOracleAdapter(RuntimeProperties runtimeProperties, List<ExtendedType> defaultExtendedTypes, List<ExtendedType> userExtendedTypes, List<ExtendedTypeFactory> extendedTypeFactories, ValueObjectTypeRegistry valueObjectTypeRegistry) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbind(PreparedStatement statement, Object value, int psPosition, int psType, int psScale, ExtendedType binder) Binds a raw value to a statement parameter.buildAttribute(String name, String typeName, int type, int maxLength, int scale, boolean allowNulls) Fixes some reverse engineering problems.protected voidInstalls appropriate ExtendedTypes as converters for passing values between JDBC and Java layers.protected EJBQLTranslatorCreates and returns anEJBQLTranslatorused to generate visitors for EJBQL to SQL translations.protected NativeColumnType[]Returns the database-native types supported by this adapter.Returns aOraclePkGenerator.dropTableStatements(DbEntity table) Returns a query string to drop a table corresponding toentDbEntity.Uses OracleActionBuilder to create the right action.static intReturns an Oracle JDBC extension type defined in oracle.jdbc.driver.OracleTypes.CURSOR.protected static voidstatic booleanbooleantypeSupportsScale(int type) Returns true if supplied type can have a scale attribute as a part of column definition.Methods inherited from class org.apache.cayenne.dba.JdbcAdapter
bindParameter, bindParameter, createFkConstraint, createQuotingStrategy, createTable, createTableAppendColumn, createTableAppendPKClause, createUniqueConstraint, defaultCharColumnLength, externalTypesForJdbcType, getBatchTerminator, getEjbqlTranslator, getExtendedTypes, getProcedureTranslator, getQuotingStrategy, getQuotingStrategy, getSelectTranslator, getSQLLogger, getSystemCatalogs, getType, initExtendedTypes, nativeColumnTypes, setEjbqlTranslator, setEjbqlTranslatorFactory, setSupportsBatchUpdates, setSupportsGeneratedKeys, setSupportsUniqueConstraints, sizeAndPrecision, sizeAndScale, supportsBatchUpdates, supportsCatalogsOnReverseEngineering, supportsGeneratedKeys, supportsUniqueConstraints, tableTypeForTable, tableTypeForView, typeSupportsLength, unwrapMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.cayenne.dba.DbAdapter
getEjbqlTranslatorFactory, preferredBindingType, preferredNativeColumnType, supportsGeneratedKeysForBatchInserts
-
Field Details
-
ORACLE_FLOAT
- See Also:
-
ORACLE_BLOB
- See Also:
-
ORACLE_CLOB
- See Also:
-
ORACLE_NCLOB
- See Also:
-
TRIM_FUNCTION
- See Also:
-
NEW_CLOB_FUNCTION
- See Also:
-
NEW_BLOB_FUNCTION
- See Also:
-
initDone
protected static boolean initDone -
oracleCursorType
protected static int oracleCursorType -
supportsOracleLOB
protected static boolean supportsOracleLOB
-
-
Constructor Details
-
OracleAdapter
public OracleAdapter(RuntimeProperties runtimeProperties, List<ExtendedType> defaultExtendedTypes, List<ExtendedType> userExtendedTypes, List<ExtendedTypeFactory> extendedTypeFactories, ValueObjectTypeRegistry valueObjectTypeRegistry)
-
-
Method Details
-
initDriverInformation
protected static void initDriverInformation() -
isSupportsOracleLOB
public static boolean isSupportsOracleLOB() -
getOracleCursorType
public static int getOracleCursorType()Returns an Oracle JDBC extension type defined in oracle.jdbc.driver.OracleTypes.CURSOR. This value is determined from Oracle driver classes via reflection in runtime, so that Cayenne code has no compile dependency on the driver. This means that calling this method when the driver is not available will result in an exception. -
createNativeTypes
Description copied from class:JdbcAdapterReturns the database-native types supported by this adapter.- Overrides:
createNativeTypesin classJdbcAdapter
-
createPkGenerator
Returns aOraclePkGenerator.- Specified by:
createPkGeneratorin interfaceDbAdapter- Overrides:
createPkGeneratorin classJdbcAdapter
-
getSqlTreeProcessor
- Specified by:
getSqlTreeProcessorin interfaceDbAdapter- Overrides:
getSqlTreeProcessorin classJdbcAdapter- Returns:
SQLTreeProcessorthat can adjust SQL tree to specific database flavour- Since:
- 4.2
-
createEJBQLTranslator
Description copied from class:JdbcAdapterCreates and returns anEJBQLTranslatorused to generate visitors for EJBQL to SQL translations. This method should be overriden by subclasses that need to customize EJBQL generation.- Overrides:
createEJBQLTranslatorin classJdbcAdapter- Since:
- 3.0
-
configureExtendedTypes
Installs appropriate ExtendedTypes as converters for passing values between JDBC and Java layers.- Overrides:
configureExtendedTypesin classJdbcAdapter
-
dropTableStatements
Returns a query string to drop a table corresponding toentDbEntity. Changes superclass behavior to drop all related foreign key constraints.- Specified by:
dropTableStatementsin interfaceDbAdapter- Overrides:
dropTableStatementsin classJdbcAdapter- Since:
- 3.0
-
bind
protected void bind(PreparedStatement statement, Object value, int psPosition, int psType, int psScale, ExtendedType binder) throws Exception Description copied from class:JdbcAdapterBinds a raw value to a statement parameter. This is the single extension point shared by bothbindParameteroverloads; adapters that need database-specific handling (e.g. of NULLs) should override this method rather than the public overloads.- Overrides:
bindin classJdbcAdapter- Throws:
Exception
-
buildAttribute
public DbAttribute buildAttribute(String name, String typeName, int type, int maxLength, int scale, boolean allowNulls) Fixes some reverse engineering problems. Namely if a columns is created as DECIMAL and has non-positive precision it is converted to INTEGER.- Specified by:
buildAttributein interfaceDbAdapter- Overrides:
buildAttributein classJdbcAdapter- Parameters:
name- database column nametypeName- database specific type name, may be used as a hint to determine the right JDBC type.type- JDBC column typemaxLength- database column size (ignored if less than zero)scale- database column scale, i.e. the number of decimal digits (ignored if less than zero)allowNulls- database column nullable parameter
-
getAction
Uses OracleActionBuilder to create the right action.- Specified by:
getActionin interfaceDbAdapter- Overrides:
getActionin classJdbcAdapter- Since:
- 1.2
-
getSystemSchemas
- Specified by:
getSystemSchemasin interfaceDbAdapter- Overrides:
getSystemSchemasin classJdbcAdapter- Returns:
- list of system schemas
-
typeSupportsScale
public boolean typeSupportsScale(int type) Description copied from class:JdbcAdapterReturns true if supplied type can have a scale attribute as a part of column definition.- Specified by:
typeSupportsScalein interfaceDbAdapter- Overrides:
typeSupportsScalein classJdbcAdapter- Parameters:
type- sql type code- Returns:
trueif a given type supports scale- Since:
- 5.0
-