org.apache.cayenne.dba.hsqldb
Class HSQLDBAdapter

java.lang.Object
  extended by org.apache.cayenne.dba.JdbcAdapter
      extended by org.apache.cayenne.dba.hsqldb.HSQLDBAdapter
All Implemented Interfaces:
DbAdapter
Direct Known Subclasses:
HSQLDBNoSchemaAdapter

public class HSQLDBAdapter
extends JdbcAdapter

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

        test-hsqldb.cayenne.adapter = org.apache.cayenne.dba.hsqldb.HSQLDBAdapter
        test-hsqldb.jdbc.username = test
        test-hsqldb.jdbc.password = secret
        test-hsqldb.jdbc.url = jdbc:hsqldb:hsql://serverhostname
        test-hsqldb.jdbc.driver = org.hsqldb.jdbcDriver
 


Field Summary
 
Fields inherited from class org.apache.cayenne.dba.JdbcAdapter
ejbqlTranslatorFactory, extendedTypes, identifiersEndQuote, identifiersStartQuote, pkGenerator, supportsBatchUpdates, supportsFkConstraints, supportsGeneratedKeys, supportsUniqueConstraints, typesHandler
 
Constructor Summary
HSQLDBAdapter()
           
 
Method Summary
 String createFkConstraint(DbRelationship rel)
          Adds an ADD CONSTRAINT clause to a relationship constraint.
 String createTable(DbEntity ent)
          Uses "CREATE CACHED TABLE" instead of "CREATE TABLE".
 void createTableAppendColumn(StringBuffer sqlBuffer, DbAttribute column)
          Appends SQL for column creation to CREATE TABLE buffer.
 String createUniqueConstraint(DbEntity source, Collection<DbAttribute> columns)
          Returns a DDL string to create a unique constraint over a set of columns.
 SQLAction getAction(Query query, DataNode node)
          Uses special action builder to create the right action.
protected  String getSchemaName(DbEntity entity)
          Generate fully-qualified name for 1.8 and on.
protected  String getTableName(DbEntity entity)
          Generate fully-qualified name for 1.8 and on.
 MergerFactory mergerFactory()
           
 
Methods inherited from class org.apache.cayenne.dba.JdbcAdapter
bindParameter, buildAttribute, configureExtendedTypes, createEJBQLTranslatorFactory, createPkGenerator, createTableAppendPKClause, dropTable, dropTableStatements, externalTypesForJdbcType, findAdapterResource, findResource, getBatchTerminator, getEjbqlTranslatorFactory, getExtendedTypes, getIdentifiersEndQuote, getIdentifiersStartQuote, getPkGenerator, getQualifierTranslator, 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

HSQLDBAdapter

public HSQLDBAdapter()
Method Detail

getTableName

protected String getTableName(DbEntity entity)
Generate fully-qualified name for 1.8 and on. Subclass generates unqualified name.

Since:
1.2

getSchemaName

protected String getSchemaName(DbEntity entity)
Generate fully-qualified name for 1.8 and on. Subclass generates unqualified name.

Since:
1.2

getAction

public SQLAction getAction(Query query,
                           DataNode node)
Uses special action builder to create the right action.

Specified by:
getAction in interface DbAdapter
Overrides:
getAction in class JdbcAdapter
Since:
1.2

createUniqueConstraint

public String createUniqueConstraint(DbEntity source,
                                     Collection<DbAttribute> columns)
Returns a DDL string to create a unique constraint over a set of columns.

Specified by:
createUniqueConstraint in interface DbAdapter
Overrides:
createUniqueConstraint in class JdbcAdapter
Since:
1.1

createFkConstraint

public String createFkConstraint(DbRelationship rel)
Adds an ADD CONSTRAINT clause to a relationship constraint.

Specified by:
createFkConstraint in interface DbAdapter
Overrides:
createFkConstraint in class JdbcAdapter
See Also:
JdbcAdapter.createFkConstraint(DbRelationship)

createTable

public String createTable(DbEntity ent)
Uses "CREATE CACHED TABLE" instead of "CREATE TABLE".

Specified by:
createTable in interface DbAdapter
Overrides:
createTable in class JdbcAdapter
Since:
1.2

createTableAppendColumn

public void createTableAppendColumn(StringBuffer sqlBuffer,
                                    DbAttribute column)
Description copied from class: JdbcAdapter
Appends SQL for column creation to CREATE TABLE buffer.

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

mergerFactory

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


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