org.exolab.castor.jdo.drivers
Class SybaseFactory

java.lang.Object
  extended by org.exolab.castor.jdo.engine.BaseFactory
      extended by org.exolab.castor.jdo.drivers.GenericFactory
          extended by org.exolab.castor.jdo.drivers.SybaseFactory
All Implemented Interfaces:
PersistenceFactory
Direct Known Subclasses:
SQLServerFactory

public class SybaseFactory
extends GenericFactory

PersistenceFactory for Sybase Adaptive Servers.

Version:
$Revision: 1.2 $ $Date: 2004/01/19 20:01:46 $
Author:
Assaf Arkin, Oleg Nitz

Constructor Summary
SybaseFactory()
           
 
Method Summary
 PersistenceQuery getCallQuery(java.lang.String call, java.lang.Class[] paramTypes, java.lang.Class javaClass, java.lang.String[] fields, int[] sqlTypes)
          Needed to process OQL queries of "CALL" type (using stored procedure call).
 java.lang.String getFactoryName()
          Returns the name of this factory.
 QueryExpression getQueryExpression()
          Returns a new empty query expression suitable for the underlying SQL engine.
 java.lang.Boolean isDuplicateKeyException(java.lang.Exception except)
          Determine if the given SQLException is DuplicateKeyException
 java.lang.String quoteName(java.lang.String name)
          Returns the quoted identifier suitable for preventing conflicts between database identifiers and reserved keywords.
 boolean supportsSetNullInWhere()
          Sybase supports setNull for "WHERE fld=?".
 
Methods inherited from class org.exolab.castor.jdo.drivers.GenericFactory
doubleQuoteName
 
Methods inherited from class org.exolab.castor.jdo.engine.BaseFactory
adjustSqlType, getPersistence
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SybaseFactory

public SybaseFactory()
Method Detail

getFactoryName

public java.lang.String getFactoryName()
Description copied from interface: PersistenceFactory
Returns the name of this factory. A descriptive name that indicates the type of supported database server or SQL syntax.

Specified by:
getFactoryName in interface PersistenceFactory
Overrides:
getFactoryName in class GenericFactory
Returns:
The name of this factory

getQueryExpression

public QueryExpression getQueryExpression()
Description copied from interface: PersistenceFactory
Returns a new empty query expression suitable for the underlying SQL engine. The implementation will construct SQL query statements in the preferred syntax.

Specified by:
getQueryExpression in interface PersistenceFactory
Overrides:
getQueryExpression in class GenericFactory
Returns:
New empty query expression

isDuplicateKeyException

public java.lang.Boolean isDuplicateKeyException(java.lang.Exception except)
Description copied from class: GenericFactory
Determine if the given SQLException is DuplicateKeyException

Specified by:
isDuplicateKeyException in interface PersistenceFactory
Overrides:
isDuplicateKeyException in class GenericFactory
Returns:
Boolean.TRUE means "yes", Boolean.FALSE means "no", null means "cannot determine"

quoteName

public java.lang.String quoteName(java.lang.String name)
Description copied from interface: PersistenceFactory
Returns the quoted identifier suitable for preventing conflicts between database identifiers and reserved keywords.

Specified by:
quoteName in interface PersistenceFactory
Overrides:
quoteName in class GenericFactory
Parameters:
name - The identifier (table, column, etc)
Returns:
The quoted identifier

getCallQuery

public PersistenceQuery getCallQuery(java.lang.String call,
                                     java.lang.Class[] paramTypes,
                                     java.lang.Class javaClass,
                                     java.lang.String[] fields,
                                     int[] sqlTypes)
Needed to process OQL queries of "CALL" type (using stored procedure call). This feature is specific for JDO.

Overrides:
getCallQuery in class BaseFactory
Parameters:
call - Stored procedure call (without "{call")
paramTypes - The types of the query parameters
javaClass - The Java class of the query results
fields - The field names
sqlTypes - The field SQL types
Returns:
null if this feature is not supported.

supportsSetNullInWhere

public boolean supportsSetNullInWhere()
Sybase supports setNull for "WHERE fld=?".

Overrides:
supportsSetNullInWhere in class BaseFactory


Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com