Package org.apache.cayenne.dba.derby
Class DerbyAdapter
java.lang.Object
org.apache.cayenne.dba.JdbcAdapter
org.apache.cayenne.dba.derby.DerbyAdapter
- All Implemented Interfaces:
DbAdapter
DbAdapter implementation for the Derby RDBMS
. Sample connection settings to use with Derby are shown below.
Embedded
test-derby.jdbc.url = jdbc:derby:testdb;create=true test-derby.jdbc.driver = org.apache.derby.jdbc.EmbeddedDriver
Network Server
derbynet.jdbc.url = jdbc:derby://localhost/cayenne derbynet.jdbc.driver = org.apache.derby.jdbc.ClientDriver derbynet.jdbc.username = someuser derbynet.jdbc.password = secret;
-
Field Summary
Fields inherited from class org.apache.cayenne.dba.JdbcAdapter
caseInsensitiveCollations, ejbqlTranslatorFactory, extendedTypes, logger, quotingStrategy, resourceLocator, supportsBatchUpdates, supportsGeneratedKeys, supportsUniqueConstraints, typesHandler -
Constructor Summary
ConstructorsConstructorDescriptionDerbyAdapter(RuntimeProperties runtimeProperties, List<ExtendedType> defaultExtendedTypes, List<ExtendedType> userExtendedTypes, List<ExtendedTypeFactory> extendedTypeFactories, ResourceLocator resourceLocator, ValueObjectTypeRegistry valueObjectTypeRegistry) -
Method Summary
Modifier and TypeMethodDescriptionvoidbindParameter(PreparedStatement statement, ParameterBinding binding) Binds an object value to PreparedStatement's parameter.protected voidInstalls appropriate ExtendedTypes as converters for passing values between JDBC and Java layers.protected EJBQLTranslatorFactoryCreates and returns anEJBQLTranslatorFactoryused to generate visitors for EJBQL to SQL translations.voidcreateTableAppendColumn(StringBuffer sqlBuffer, DbAttribute column) Appends SQL for column creation to CREATE TABLE buffer.Uses JdbcActionBuilder to create the right action.booleanNot supported, see: DERBY-3609booleantypeSupportsLength(int type) Returns true if supplied type can have a length attribute as a part of column definitionbooleantypeSupportsScale(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
buildAttribute, createFkConstraint, createQuotingStrategy, createTable, createTableAppendPKClause, createUniqueConstraint, dropTableStatements, externalTypesForJdbcType, findResource, getBatchTerminator, getEjbqlTranslatorFactory, getExtendedTypes, getJdbcEventLogger, getPkGenerator, getQuotingStrategy, getSelectTranslator, getSystemCatalogs, getSystemSchemas, getType, initExtendedTypes, setEjbqlTranslatorFactory, setPkGenerator, setSupportsBatchUpdates, setSupportsGeneratedKeys, setSupportsUniqueConstraints, sizeAndPrecision, supportsBatchUpdates, supportsCatalogsOnReverseEngineering, supportsGeneratedKeys, supportsUniqueConstraints, tableTypeForTable, tableTypeForView, unwrap
-
Constructor Details
-
DerbyAdapter
public DerbyAdapter(RuntimeProperties runtimeProperties, List<ExtendedType> defaultExtendedTypes, List<ExtendedType> userExtendedTypes, List<ExtendedTypeFactory> extendedTypeFactories, ResourceLocator resourceLocator, ValueObjectTypeRegistry valueObjectTypeRegistry)
-
-
Method Details
-
supportsGeneratedKeysForBatchInserts
public boolean supportsGeneratedKeysForBatchInserts()Not supported, see: DERBY-3609- See Also:
-
getAction
Description copied from class:JdbcAdapterUses JdbcActionBuilder to create the right action.- Specified by:
getActionin interfaceDbAdapter- Overrides:
getActionin classJdbcAdapter
-
configureExtendedTypes
Installs appropriate ExtendedTypes as converters for passing values between JDBC and Java layers.- Overrides:
configureExtendedTypesin classJdbcAdapter
-
createTableAppendColumn
Appends SQL for column creation to CREATE TABLE buffer. Only change for Derby is that " NULL" is not supported.- Specified by:
createTableAppendColumnin interfaceDbAdapter- Overrides:
createTableAppendColumnin classJdbcAdapter- Parameters:
sqlBuffer- theStringBufferto append the column type tocolumn- theDbAttributedefining the column to append type for- Since:
- 1.2
-
typeSupportsLength
public boolean typeSupportsLength(int type) Description copied from class:JdbcAdapterReturns true if supplied type can have a length attribute as a part of column definition- Specified by:
typeSupportsLengthin interfaceDbAdapter- Overrides:
typeSupportsLengthin classJdbcAdapter
-
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
-
getSqlTreeProcessor
- Specified by:
getSqlTreeProcessorin interfaceDbAdapter- Overrides:
getSqlTreeProcessorin classJdbcAdapter- Returns:
SQLTreeProcessorthat can adjust SQL tree to specific database flavour- Since:
- 4.2
-
createEJBQLTranslatorFactory
Description copied from class:JdbcAdapterCreates and returns anEJBQLTranslatorFactoryused to generate visitors for EJBQL to SQL translations. This method should be overriden by subclasses that need to customize EJBQL generation.- Overrides:
createEJBQLTranslatorFactoryin classJdbcAdapter- Since:
- 3.1
-
bindParameter
public void bindParameter(PreparedStatement statement, ParameterBinding binding) throws SQLException, Exception Description copied from interface:DbAdapterBinds an object value to PreparedStatement's parameter.- Specified by:
bindParameterin interfaceDbAdapter- Overrides:
bindParameterin classJdbcAdapter- Throws:
SQLExceptionException
-