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
- Direct Known Subclasses:
Oracle8Adapter
DbAdapter implementation for Oracle RDBMS
. Sample connection settings to use with Oracle are shown below:
test-oracle.jdbc.username = test test-oracle.jdbc.password = secret test-oracle.jdbc.url = jdbc:oracle:thin:@//192.168.0.20:1521/ora1 test-oracle.jdbc.driver = oracle.jdbc.driver.OracleDriver
-
Field Summary
Modifier and TypeFieldDescriptionprotected static boolean
static final String
static final String
static final String
static final String
static final String
static final String
protected static int
protected static boolean
static final String
Fields inherited from class org.apache.cayenne.dba.JdbcAdapter
batchQueryBuilderFactory, caseInsensitiveCollations, ejbqlTranslatorFactory, extendedTypes, logger, quotingStrategy, resourceLocator, supportsBatchUpdates, supportsGeneratedKeys, supportsUniqueConstraints, typesHandler
-
Constructor Summary
ConstructorDescriptionOracleAdapter
(RuntimeProperties runtimeProperties, List<ExtendedType> defaultExtendedTypes, List<ExtendedType> userExtendedTypes, List<ExtendedTypeFactory> extendedTypeFactories, ResourceLocator resourceLocator, ValueObjectTypeRegistry valueObjectTypeRegistry) -
Method Summary
Modifier and TypeMethodDescriptionvoid
bindParameter
(PreparedStatement statement, ParameterBinding binding) Binds an object value to PreparedStatement's parameter.buildAttribute
(String name, String typeName, int type, int size, int scale, boolean allowNulls) Fixes some reverse engineering problems.protected void
Installs appropriate ExtendedTypes as converters for passing values between JDBC and Java layers.protected EJBQLTranslatorFactory
Creates and returns anEJBQLTranslatorFactory
used to generate visitors for EJBQL to SQL translations.protected PkGenerator
Creates and returns a primary key generator.dropTableStatements
(DbEntity table) Returns a query string to drop a table corresponding toent
DbEntity.Uses OracleActionBuilder to create the right action.static int
Returns an Oracle JDBC extension type defined in oracle.jdbc.driver.OracleTypes.CURSOR.protected static void
static boolean
Methods inherited from class org.apache.cayenne.dba.JdbcAdapter
createFkConstraint, createQuotingStrategy, createTable, createTableAppendColumn, createTableAppendPKClause, createUniqueConstraint, externalTypesForJdbcType, findResource, getBatchTerminator, getEjbqlTranslatorFactory, getExtendedTypes, getJdbcEventLogger, getPkGenerator, getQuotingStrategy, getSelectTranslator, getSelectTranslator, getSystemCatalogs, getType, initExtendedTypes, setEjbqlTranslatorFactory, setPkGenerator, setSupportsBatchUpdates, setSupportsGeneratedKeys, setSupportsUniqueConstraints, sizeAndPrecision, supportsBatchUpdates, supportsCatalogsOnReverseEngineering, supportsGeneratedKeys, supportsUniqueConstraints, tableTypeForTable, tableTypeForView, typeSupportsLength, unwrap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.cayenne.dba.DbAdapter
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, ResourceLocator resourceLocator, 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. -
getSqlTreeProcessor
- Specified by:
getSqlTreeProcessor
in interfaceDbAdapter
- Overrides:
getSqlTreeProcessor
in classJdbcAdapter
- Returns:
SQLTreeProcessor
that can adjust SQL tree to specific database flavour- Since:
- 4.2
-
createEJBQLTranslatorFactory
Description copied from class:JdbcAdapter
Creates and returns anEJBQLTranslatorFactory
used to generate visitors for EJBQL to SQL translations. This method should be overriden by subclasses that need to customize EJBQL generation.- Overrides:
createEJBQLTranslatorFactory
in classJdbcAdapter
- Since:
- 3.0
-
configureExtendedTypes
Installs appropriate ExtendedTypes as converters for passing values between JDBC and Java layers.- Overrides:
configureExtendedTypes
in classJdbcAdapter
-
createPkGenerator
Creates and returns a primary key generator. Overrides superclass implementation to return an instance of OraclePkGenerator.- Overrides:
createPkGenerator
in classJdbcAdapter
-
dropTableStatements
Returns a query string to drop a table corresponding toent
DbEntity. Changes superclass behavior to drop all related foreign key constraints.- Specified by:
dropTableStatements
in interfaceDbAdapter
- Overrides:
dropTableStatements
in classJdbcAdapter
- Since:
- 3.0
-
bindParameter
public void bindParameter(PreparedStatement statement, ParameterBinding binding) throws SQLException, Exception Description copied from interface:DbAdapter
Binds an object value to PreparedStatement's parameter.- Specified by:
bindParameter
in interfaceDbAdapter
- Overrides:
bindParameter
in classJdbcAdapter
- Throws:
SQLException
Exception
-
buildAttribute
public DbAttribute buildAttribute(String name, String typeName, int type, int size, 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:
buildAttribute
in interfaceDbAdapter
- Overrides:
buildAttribute
in 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 typesize
- 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:
getAction
in interfaceDbAdapter
- Overrides:
getAction
in classJdbcAdapter
- Since:
- 1.2
-
getSystemSchemas
- Specified by:
getSystemSchemas
in interfaceDbAdapter
- Overrides:
getSystemSchemas
in classJdbcAdapter
- Returns:
- list of system schemas
-