org.apache.cayenne.dba.derby
Class DerbyAdapter

java.lang.Object
  extended by org.apache.cayenne.dba.JdbcAdapter
      extended by org.apache.cayenne.dba.derby.DerbyAdapter
All Implemented Interfaces:
DbAdapter

public class DerbyAdapter
extends JdbcAdapter

DbAdapter implementation for the Derby RDBMS . Sample connection settings to use with Derby are shown below.

Embedded

  test-derby.cayenne.adapter = org.apache.cayenne.dba.derby.DerbyAdapter
  test-derby.jdbc.url = jdbc:derby:testdb;create=true
  test-derby.jdbc.driver = org.apache.derby.jdbc.EmbeddedDriver
 

Network Server

  derbynet.cayenne.adapter = org.apache.cayenne.dba.derby.DerbyAdapter
  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
ejbqlTranslatorFactory, extendedTypes, identifiersEndQuote, identifiersStartQuote, pkGenerator, supportsBatchUpdates, supportsFkConstraints, supportsGeneratedKeys, supportsUniqueConstraints, typesHandler
 
Constructor Summary
DerbyAdapter()
           
 
Method Summary
 void bindParameter(PreparedStatement statement, Object object, int pos, int sqlType, int precision)
          Binds an object value to PreparedStatement's numbered parameter.
protected  void configureExtendedTypes(ExtendedTypeMap map)
          Installs appropriate ExtendedTypes as converters for passing values between JDBC and Java layers.
protected  PkGenerator createPkGenerator()
          Creates and returns a primary key generator.
 void createTableAppendColumn(StringBuffer sqlBuffer, DbAttribute column)
          Appends SQL for column creation to CREATE TABLE buffer.
 QualifierTranslator getQualifierTranslator(QueryAssembler queryAssembler)
          Returns a trimming translator.
 MergerFactory mergerFactory()
           
 
Methods inherited from class org.apache.cayenne.dba.JdbcAdapter
buildAttribute, createEJBQLTranslatorFactory, createFkConstraint, createTable, createTableAppendPKClause, createUniqueConstraint, dropTable, dropTableStatements, externalTypesForJdbcType, findAdapterResource, findResource, getAction, getBatchTerminator, getEjbqlTranslatorFactory, getExtendedTypes, getIdentifiersEndQuote, getIdentifiersStartQuote, getPkGenerator, getQuotingStrategy, initIdentifiersQuotes, setEjbqlTranslatorFactory, setPkGenerator, setSupportsBatchUpdates, setSupportsFkConstraints, setSupportsGeneratedKeys, setSupportsUniqueConstraints, supportsBatchUpdates, supportsFkConstraints, supportsGeneratedKeys, supportsUniqueConstraints, tableTypeForTable, tableTypeForView
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DerbyAdapter

public DerbyAdapter()
Method Detail

createPkGenerator

protected PkGenerator createPkGenerator()
Description copied from class: JdbcAdapter
Creates and returns a primary key generator. This factory method should be overriden by JdbcAdapter subclasses to provide custom implementations of PKGenerator.

Overrides:
createPkGenerator in class JdbcAdapter

configureExtendedTypes

protected void configureExtendedTypes(ExtendedTypeMap map)
Installs appropriate ExtendedTypes as converters for passing values between JDBC and Java layers.

Overrides:
configureExtendedTypes in class JdbcAdapter

createTableAppendColumn

public void createTableAppendColumn(StringBuffer sqlBuffer,
                                    DbAttribute column)
Appends SQL for column creation to CREATE TABLE buffer. Only change for Derby is that " NULL" is not supported.

Specified by:
createTableAppendColumn in interface DbAdapter
Overrides:
createTableAppendColumn in class JdbcAdapter
Parameters:
sqlBuffer - the StringBuffer to append the column type to
column - the DbAttribute defining the column to append type for
Since:
1.2

getQualifierTranslator

public QualifierTranslator getQualifierTranslator(QueryAssembler queryAssembler)
Returns a trimming translator.

Specified by:
getQualifierTranslator in interface DbAdapter
Overrides:
getQualifierTranslator in class JdbcAdapter

mergerFactory

public MergerFactory mergerFactory()
Specified by:
mergerFactory in interface DbAdapter
Overrides:
mergerFactory in class JdbcAdapter

bindParameter

public void bindParameter(PreparedStatement statement,
                          Object object,
                          int pos,
                          int sqlType,
                          int precision)
                   throws SQLException,
                          Exception
Description copied from interface: DbAdapter
Binds an object value to PreparedStatement's numbered parameter.

Specified by:
bindParameter in interface DbAdapter
Overrides:
bindParameter in class JdbcAdapter
Throws:
SQLException
Exception


Copyright © 2001-2011 Apache Cayenne. All Rights Reserved.