org.exolab.castor.jdo.engine
Class BaseFactory

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

public abstract class BaseFactory
extends java.lang.Object
implements PersistenceFactory

PersistenceFactory for generic JDBC driver.

Version:
$Revision: 1.4 $ $Date: 2005/07/15 21:59:16 $
Author:
Assaf Arkin, Bruce Snyder

Constructor Summary
BaseFactory()
           
 
Method Summary
 java.lang.Class adjustSqlType(java.lang.Class sqlType)
          Some databases has some problems with some SQL types.
 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).
 Persistence getPersistence(ClassDescriptor clsDesc)
          Returns a persistence implementation for the specified object type (given its descriptor) on behalf of the specified cache engine.
 boolean supportsSetNullInWhere()
          Many databases don't support setNull for "WHERE fld=?" and require "WHERE fld IS NULL".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.exolab.castor.persist.spi.PersistenceFactory
getFactoryName, getQueryExpression, isDuplicateKeyException, quoteName
 

Constructor Detail

BaseFactory

public BaseFactory()
Method Detail

getPersistence

public Persistence getPersistence(ClassDescriptor clsDesc)
Description copied from interface: PersistenceFactory
Returns a persistence implementation for the specified object type (given its descriptor) on behalf of the specified cache engine. Return null if no persistence support is available for the specified object type.

Specified by:
getPersistence in interface PersistenceFactory
Parameters:
clsDesc - The class descriptor (may be null)
Returns:
A suiteable persistence implementation, or null
See Also:
PersistenceFactory.getPersistence(org.exolab.castor.mapping.ClassDescriptor)

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.

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.

adjustSqlType

public java.lang.Class adjustSqlType(java.lang.Class sqlType)
Some databases has some problems with some SQL types. Usually it is enough to merely replace one SQL type by another.

Parameters:
sqlType - The correspondent Java class for the SQL type in mapping.xml
Returns:
The correspondent Java class for the SQL type that should be used instead.

supportsSetNullInWhere

public boolean supportsSetNullInWhere()
Many databases don't support setNull for "WHERE fld=?" and require "WHERE fld IS NULL".



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