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
extendedTypes, pkGenerator, supportsBatchUpdates, supportsFkConstraints, supportsGeneratedKeys, supportsUniqueConstraints, typesHandler
 
Constructor Summary
DerbyAdapter()
           
 
Method Summary
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.
protected  void createTableAppendColumn(java.lang.StringBuffer sqlBuffer, DbAttribute column)
          Appends SQL for column creation to CREATE TABLE buffer.
 QualifierTranslator getQualifierTranslator(QueryAssembler queryAssembler)
          Returns a trimming translator.
 
Methods inherited from class org.apache.cayenne.dba.JdbcAdapter
bindParameter, buildAttribute, createDataNode, createFkConstraint, createTable, createTableAppendPKClause, createUniqueConstraint, dropTable, externalTypesForJdbcType, findAdapterResource, getAction, getBatchTerminator, getExtendedTypes, getPkGenerator, getQueryTranslator, queryTranslatorClass, setPkGenerator, setSupportsBatchUpdates, setSupportsFkConstraints, setSupportsGeneratedKeys, setSupportsUniqueConstraints, shouldRunBatchQuery, 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

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

Overrides:
createTableAppendColumn in class JdbcAdapter
Since:
1.2

getQualifierTranslator

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

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


Copyright © 2001-2006 Apache.org All Rights Reserved.