public class OracleAdapter extends JdbcAdapter
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
Modifier and Type | Field and Description |
---|---|
protected static boolean |
initDone |
static String |
NEW_BLOB_FUNCTION |
static String |
NEW_CLOB_FUNCTION |
static String |
ORACLE_BLOB |
static String |
ORACLE_CLOB |
static String |
ORACLE_FLOAT |
static String |
ORACLE_NCLOB |
protected static int |
oracleCursorType |
protected static boolean |
supportsOracleLOB |
static String |
TRIM_FUNCTION |
batchQueryBuilderFactory, caseInsensitiveCollations, ejbqlTranslatorFactory, extendedTypes, logger, quotingStrategy, resourceLocator, supportsBatchUpdates, supportsGeneratedKeys, supportsUniqueConstraints, typesHandler
Constructor and Description |
---|
OracleAdapter(RuntimeProperties runtimeProperties,
List<ExtendedType> defaultExtendedTypes,
List<ExtendedType> userExtendedTypes,
List<ExtendedTypeFactory> extendedTypeFactories,
ResourceLocator resourceLocator,
ValueObjectTypeRegistry valueObjectTypeRegistry) |
Modifier and Type | Method and Description |
---|---|
void |
bindParameter(PreparedStatement statement,
ParameterBinding binding)
Binds an object value to PreparedStatement's parameter.
|
DbAttribute |
buildAttribute(String name,
String typeName,
int type,
int size,
int scale,
boolean allowNulls)
Fixes some reverse engineering problems.
|
protected void |
configureExtendedTypes(ExtendedTypeMap map)
Installs appropriate ExtendedTypes as converters for passing values
between JDBC and Java layers.
|
protected EJBQLTranslatorFactory |
createEJBQLTranslatorFactory()
Creates and returns an
EJBQLTranslatorFactory used to generate
visitors for EJBQL to SQL translations. |
protected PkGenerator |
createPkGenerator()
Creates and returns a primary key generator.
|
Collection<String> |
dropTableStatements(DbEntity table)
Returns a query string to drop a table corresponding to
ent
DbEntity. |
SQLAction |
getAction(Query query,
DataNode node)
Uses OracleActionBuilder to create the right action.
|
static int |
getOracleCursorType()
Returns an Oracle JDBC extension type defined in
oracle.jdbc.driver.OracleTypes.CURSOR.
|
QualifierTranslator |
getQualifierTranslator(QueryAssembler queryAssembler)
Returns a trimming translator.
|
SelectTranslator |
getSelectTranslator(SelectQuery<?> query,
EntityResolver entityResolver)
Returns a SelectTranslator that works with the adapter target database.
|
protected static void |
initDriverInformation() |
static boolean |
isSupportsOracleLOB() |
createFkConstraint, createQuotingStrategy, createTable, createTableAppendColumn, createTableAppendPKClause, createUniqueConstraint, externalTypesForJdbcType, findResource, getBatchQueryBuilderFactory, getBatchTerminator, getEjbqlTranslatorFactory, getExtendedTypes, getJdbcEventLogger, getPkGenerator, getQuotingStrategy, getQuotingStrategy, getType, initExtendedTypes, setBatchQueryBuilderFactory, setEjbqlTranslatorFactory, setPkGenerator, setSupportsBatchUpdates, setSupportsGeneratedKeys, setSupportsUniqueConstraints, sizeAndPrecision, supportsBatchUpdates, supportsCatalogsOnReverseEngineering, supportsGeneratedKeys, supportsUniqueConstraints, tableTypeForTable, tableTypeForView, typeSupportsLength, unwrap
public static final String ORACLE_FLOAT
public static final String ORACLE_BLOB
public static final String ORACLE_CLOB
public static final String ORACLE_NCLOB
public static final String TRIM_FUNCTION
public static final String NEW_CLOB_FUNCTION
public static final String NEW_BLOB_FUNCTION
protected static boolean initDone
protected static int oracleCursorType
protected static boolean supportsOracleLOB
public OracleAdapter(RuntimeProperties runtimeProperties, List<ExtendedType> defaultExtendedTypes, List<ExtendedType> userExtendedTypes, List<ExtendedTypeFactory> extendedTypeFactories, ResourceLocator resourceLocator, ValueObjectTypeRegistry valueObjectTypeRegistry)
protected static void initDriverInformation()
public static boolean isSupportsOracleLOB()
public static int getOracleCursorType()
public SelectTranslator getSelectTranslator(SelectQuery<?> query, EntityResolver entityResolver)
DbAdapter
getSelectTranslator
in interface DbAdapter
getSelectTranslator
in class JdbcAdapter
protected EJBQLTranslatorFactory createEJBQLTranslatorFactory()
JdbcAdapter
EJBQLTranslatorFactory
used to generate
visitors for EJBQL to SQL translations. This method should be overriden
by subclasses that need to customize EJBQL generation.createEJBQLTranslatorFactory
in class JdbcAdapter
protected void configureExtendedTypes(ExtendedTypeMap map)
configureExtendedTypes
in class JdbcAdapter
protected PkGenerator createPkGenerator()
createPkGenerator
in class JdbcAdapter
public Collection<String> dropTableStatements(DbEntity table)
ent
DbEntity. Changes superclass behavior to drop all related foreign key
constraints.dropTableStatements
in interface DbAdapter
dropTableStatements
in class JdbcAdapter
public void bindParameter(PreparedStatement statement, ParameterBinding binding) throws SQLException, Exception
DbAdapter
bindParameter
in interface DbAdapter
bindParameter
in class JdbcAdapter
SQLException
Exception
public DbAttribute buildAttribute(String name, String typeName, int type, int size, int scale, boolean allowNulls)
buildAttribute
in interface DbAdapter
buildAttribute
in class JdbcAdapter
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 parameterpublic QualifierTranslator getQualifierTranslator(QueryAssembler queryAssembler)
getQualifierTranslator
in interface DbAdapter
getQualifierTranslator
in class JdbcAdapter
Copyright © 2001–2018 Apache Cayenne. All rights reserved.