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:

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

Since:
1.1
Author:
Mike Kienenberger, Andrei Adamchik

Field Summary
 
Fields inherited from class org.apache.cayenne.dba.JdbcAdapter
extendedTypes, pkGenerator, supportsBatchUpdates, supportsFkConstraints, supportsGeneratedKeys, supportsUniqueConstraints, typesHandler
 
Constructor Summary
OpenBaseAdapter()
           
 
Method Summary
 DbAttribute buildAttribute(java.lang.String name, java.lang.String typeName, int type, int size, int precision, 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.
 java.lang.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.
 java.lang.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.
 java.lang.String getBatchTerminator()
          Returns word "go".
 QualifierTranslator getQualifierTranslator(QueryAssembler queryAssembler)
          Returns OpenBase-specific translator for queries.
 java.lang.String tableTypeForView()
          Returns null, since views are not yet supported in openbase.
 
Methods inherited from class org.apache.cayenne.dba.JdbcAdapter
bindParameter, createDataNode, createTableAppendColumn, createTableAppendPKClause, createUniqueConstraint, dropTable, externalTypesForJdbcType, findAdapterResource, getExtendedTypes, getPkGenerator, getQueryTranslator, queryTranslatorClass, setPkGenerator, setSupportsBatchUpdates, setSupportsFkConstraints, setSupportsGeneratedKeys, setSupportsUniqueConstraints, shouldRunBatchQuery, 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(java.lang.String name,
                                  java.lang.String typeName,
                                  int type,
                                  int size,
                                  int precision,
                                  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)
precision - database column precision (ignored if less than zero)
allowNulls - database column nullable parameter

getBatchTerminator

public java.lang.String getBatchTerminator()
Returns word "go".

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

tableTypeForView

public java.lang.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 java.lang.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 java.lang.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


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