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 SummaryFields inherited from class org.apache.cayenne.dba.JdbcAdaptercaseInsensitiveCollations, ejbqlTranslatorFactory, extendedTypes, logger, quotingStrategy, resourceLocator, supportsBatchUpdates, supportsGeneratedKeys, supportsUniqueConstraints, typesHandler
- 
Constructor SummaryConstructorsConstructorDescriptionDerbyAdapter(RuntimeProperties runtimeProperties, List<ExtendedType> defaultExtendedTypes, List<ExtendedType> userExtendedTypes, List<ExtendedTypeFactory> extendedTypeFactories, ResourceLocator resourceLocator, ValueObjectTypeRegistry valueObjectTypeRegistry) 
- 
Method SummaryModifier 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.JdbcAdapterbuildAttribute, 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- 
DerbyAdapterpublic DerbyAdapter(RuntimeProperties runtimeProperties, List<ExtendedType> defaultExtendedTypes, List<ExtendedType> userExtendedTypes, List<ExtendedTypeFactory> extendedTypeFactories, ResourceLocator resourceLocator, ValueObjectTypeRegistry valueObjectTypeRegistry) 
 
- 
- 
Method Details- 
supportsGeneratedKeysForBatchInsertspublic boolean supportsGeneratedKeysForBatchInserts()Not supported, see: DERBY-3609- See Also:
 
- 
getActionDescription copied from class:JdbcAdapterUses JdbcActionBuilder to create the right action.- Specified by:
- getActionin interface- DbAdapter
- Overrides:
- getActionin class- JdbcAdapter
 
- 
configureExtendedTypesInstalls appropriate ExtendedTypes as converters for passing values between JDBC and Java layers.- Overrides:
- configureExtendedTypesin class- JdbcAdapter
 
- 
createTableAppendColumnAppends SQL for column creation to CREATE TABLE buffer. Only change for Derby is that " NULL" is not supported.- Specified by:
- createTableAppendColumnin interface- DbAdapter
- Overrides:
- createTableAppendColumnin class- JdbcAdapter
- Parameters:
- sqlBuffer- the- StringBufferto append the column type to
- column- the- DbAttributedefining the column to append type for
- Since:
- 1.2
 
- 
typeSupportsLengthpublic 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 interface- DbAdapter
- Overrides:
- typeSupportsLengthin class- JdbcAdapter
 
- 
typeSupportsScalepublic 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 interface- DbAdapter
- Overrides:
- typeSupportsScalein class- JdbcAdapter
- Parameters:
- type- sql type code
- Returns:
- trueif a given type supports scale
- Since:
- 5.0
 
- 
getSqlTreeProcessor- Specified by:
- getSqlTreeProcessorin interface- DbAdapter
- Overrides:
- getSqlTreeProcessorin class- JdbcAdapter
- Returns:
- SQLTreeProcessorthat can adjust SQL tree to specific database flavour
- Since:
- 4.2
 
- 
createEJBQLTranslatorFactoryDescription 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 class- JdbcAdapter
- Since:
- 3.1
 
- 
bindParameterpublic void bindParameter(PreparedStatement statement, ParameterBinding binding) throws SQLException, Exception Description copied from interface:DbAdapterBinds an object value to PreparedStatement's parameter.- Specified by:
- bindParameterin interface- DbAdapter
- Overrides:
- bindParameterin class- JdbcAdapter
- Throws:
- SQLException
- Exception
 
 
-