java.lang.Object
org.objectstyle.cayenne.dba.JdbcAdapter
org.objectstyle.cayenne.dba.oracle.OracleAdapter
- All Implemented Interfaces:
- org.objectstyle.cayenne.dba.DbAdapter
- public class OracleAdapter
- extends org.objectstyle.cayenne.dba.JdbcAdapter
DbAdapter implementation for Oracle RDBMS.
Sample connection
settings to use with Oracle are shown below:
test-oracle.cayenne.adapter = org.objectstyle.cayenne.dba.oracle.OracleAdapter
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
| Methods inherited from class org.objectstyle.cayenne.dba.JdbcAdapter |
bindParameter, createFkConstraint, createTable, externalTypesForJdbcType, getExtendedTypes, getPkGenerator, getQueryTranslator, setSupportsBatchUpdates, supportsBatchUpdates, supportsFkConstraints, tableTypeForTable, tableTypeForView |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logObj
private static org.apache.log4j.Logger logObj
ORACLE_FLOAT
public static final java.lang.String ORACLE_FLOAT
- See Also:
- Constant Field Values
ORACLE_BLOB
public static final java.lang.String ORACLE_BLOB
- See Also:
- Constant Field Values
ORACLE_CLOB
public static final java.lang.String ORACLE_CLOB
- See Also:
- Constant Field Values
TRIM_FUNCTION
public static final java.lang.String TRIM_FUNCTION
- See Also:
- Constant Field Values
NEW_CLOB_FUNCTION
public static final java.lang.String NEW_CLOB_FUNCTION
- See Also:
- Constant Field Values
NEW_BLOB_FUNCTION
public static final java.lang.String NEW_BLOB_FUNCTION
- See Also:
- Constant Field Values
initDone
protected static boolean initDone
oracleCursorType
protected static int oracleCursorType
outputStreamFromBlobMethod
protected static java.lang.reflect.Method outputStreamFromBlobMethod
writerFromClobMethod
protected static java.lang.reflect.Method writerFromClobMethod
supportsOracleLOB
protected static boolean supportsOracleLOB
OracleAdapter
public OracleAdapter()
initDriverInformation
protected static void initDriverInformation()
getOutputStreamFromBlobMethod
public static java.lang.reflect.Method getOutputStreamFromBlobMethod()
isSupportsOracleLOB
public static boolean isSupportsOracleLOB()
getWriterFromClobMethod
public static java.lang.reflect.Method getWriterFromClobMethod()
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.
configureExtendedTypes
protected void configureExtendedTypes(org.objectstyle.cayenne.access.types.ExtendedTypeMap map)
- Installs appropriate ExtendedTypes as converters for passing values
between JDBC and Java layers.
createPkGenerator
protected org.objectstyle.cayenne.dba.PkGenerator createPkGenerator()
- Creates and returns a primary key generator.
Overrides superclass implementation to return an
instance of OraclePkGenerator.
dropTable
public java.lang.String dropTable(org.objectstyle.cayenne.map.DbEntity ent)
- Returns a query string to drop a table corresponding
to
ent DbEntity. Changes superclass behavior
to drop all related foreign key constraints.
buildAttribute
public org.objectstyle.cayenne.map.DbAttribute buildAttribute(java.lang.String name,
java.lang.String typeName,
int type,
int size,
int precision,
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.
queryTranslatorClass
protected java.lang.Class queryTranslatorClass(org.objectstyle.cayenne.query.Query q)
- Returns Oracle-specific classes for SELECT queries.
getQualifierTranslator
public org.objectstyle.cayenne.access.trans.QualifierTranslator getQualifierTranslator(org.objectstyle.cayenne.access.trans.QueryAssembler queryAssembler)
- Returns a trimming translator.
createDataNode
public org.objectstyle.cayenne.access.DataNode createDataNode(java.lang.String name)
- Creates an instance of OracleDataNode.
shouldRunBatchQuery
public boolean shouldRunBatchQuery(org.objectstyle.cayenne.access.DataNode node,
java.sql.Connection con,
org.objectstyle.cayenne.query.BatchQuery query,
org.objectstyle.cayenne.access.OperationObserver delegate)
throws java.sql.SQLException,
java.lang.Exception
- Implements special LOB handling in batches.