org.apache.cayenne.dba.openbase
Class OpenBaseAdapter

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

public class OpenBaseAdapter
extends JdbcAdapter

DbAdapter implementation for OpenBase. Sample connection settings to use with OpenBase are shown below:

 openbase.cayenne.adapter = org.apache.cayenne.dba.openbase.OpenBaseAdapter
 openbase.jdbc.username = test
 openbase.jdbc.password = secret
 openbase.jdbc.url = jdbc:openbase://serverhostname/cayenne
 openbase.jdbc.driver = com.openbase.jdbc.ObDriver
 

Since:
1.1

Field Summary
 
Fields inherited from class org.apache.cayenne.dba.JdbcAdapter
ejbqlTranslatorFactory, extendedTypes, identifiersEndQuote, identifiersStartQuote, pkGenerator, supportsBatchUpdates, supportsFkConstraints, supportsGeneratedKeys, supportsUniqueConstraints, typesHandler
 
Constructor Summary
OpenBaseAdapter()
           
 
Method Summary
 DbAttribute buildAttribute(String name, String typeName, int type, int size, int scale, boolean allowNulls)
          Creates and returns a DbAttribute based on supplied parameters (usually obtained from database meta data).
protected  void configureExtendedTypes(ExtendedTypeMap map)
          Installs appropriate ExtendedTypes as converters for passing values between JDBC and Java layers.
 String createFkConstraint(DbRelationship rel)
          Returns a SQL string that can be used to create a foreign key constraint for the relationship.
protected  PkGenerator createPkGenerator()
          Creates and returns a primary key generator.
 String createTable(DbEntity ent)
          Returns a SQL string that can be used to create database table corresponding to ent parameter.
 SQLAction getAction(Query query, DataNode node)
          Uses special action builder to create the right action.
 String getBatchTerminator()
          Returns word "go".
 QualifierTranslator getQualifierTranslator(QueryAssembler queryAssembler)
          Returns OpenBase-specific translator for queries.
 MergerFactory mergerFactory()
           
 String tableTypeForView()
          Returns null, since views are not yet supported in openbase.
 
Methods inherited from class org.apache.cayenne.dba.JdbcAdapter
bindParameter, createEJBQLTranslatorFactory, createTableAppendColumn, createTableAppendPKClause, createUniqueConstraint, dropTable, dropTableStatements, externalTypesForJdbcType, findAdapterResource, findResource, getEjbqlTranslatorFactory, getExtendedTypes, getIdentifiersEndQuote, getIdentifiersStartQuote, getPkGenerator, getQuotingStrategy, initIdentifiersQuotes, setEjbqlTranslatorFactory, setPkGenerator, setSupportsBatchUpdates, setSupportsFkConstraints, setSupportsGeneratedKeys, setSupportsUniqueConstraints, supportsBatchUpdates, supportsFkConstraints, supportsGeneratedKeys, supportsUniqueConstraints, tableTypeForTable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenBaseAdapter

public OpenBaseAdapter()
Method Detail

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

configureExtendedTypes

protected void configureExtendedTypes(ExtendedTypeMap map)
Description copied from class: JdbcAdapter
Installs appropriate ExtendedTypes as converters for passing values between JDBC and Java layers. Called from default constructor.

Overrides:
configureExtendedTypes in class JdbcAdapter

buildAttribute

public DbAttribute buildAttribute(String name,
                                  String typeName,
                                  int type,
                                  int size,
                                  int scale,
                                  boolean allowNulls)
Description copied from interface: DbAdapter
Creates and returns a DbAttribute based on supplied parameters (usually obtained from database meta data).

Specified by:
buildAttribute in interface DbAdapter
Overrides:
buildAttribute in class JdbcAdapter
Parameters:
name - database column name
typeName - database specific type name, may be used as a hint to determine the right JDBC type.
type - JDBC column type
size - database column size (ignored if less than zero)
scale - database column scale, i.e. the number of decimal digits (ignored if less than zero)
allowNulls - database column nullable parameter

getBatchTerminator

public String getBatchTerminator()
Returns word "go".

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

tableTypeForView

public String tableTypeForView()
Returns null, since views are not yet supported in openbase.

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

getQualifierTranslator

public QualifierTranslator getQualifierTranslator(QueryAssembler queryAssembler)
Returns OpenBase-specific translator for queries.

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

createPkGenerator

protected PkGenerator createPkGenerator()
Creates and returns a primary key generator. Overrides superclass implementation to return an instance of OpenBasePkGenerator that uses built-in multi-server primary key generation.

Overrides:
createPkGenerator in class JdbcAdapter

createTable

public String createTable(DbEntity ent)
Returns a SQL string that can be used to create database table corresponding to ent parameter.

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

createFkConstraint

public String createFkConstraint(DbRelationship rel)
Returns a SQL string that can be used to create a foreign key constraint for the relationship.

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

mergerFactory

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


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