org.exolab.castor.jdo.engine

Class BaseFactory

Implemented Interfaces:
PersistenceFactory
Known Direct Subclasses:
GenericFactory

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

PersistenceFactory for generic JDBC driver.
Version:
$Revision: 1.1.1.1 $ $Date: 2003/03/03 07:08:16 $
Author:
Assaf Arkin

Method Summary

Class
adjustSqlType(Class sqlType)
Some databases has some problems with some SQL types.
PersistenceQuery
getCallQuery(String call, Class[] paramTypes, Class javaClass, String[] fields, int[] sqlTypes)
Needed to process OQL queries of "CALL" type (using stored procedure call).
Persistence
getPersistence(ClassDescriptor clsDesc, LogInterceptor logInterceptor)
boolean
supportsSetNullInWhere()
Many databases don't support setNull for "WHERE fld=?" and require "WHERE fld IS NULL".

Method Details

adjustSqlType

public Class adjustSqlType(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.

getCallQuery

public PersistenceQuery getCallQuery(String call,
                                     Class[] paramTypes,
                                     Class javaClass,
                                     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.

getPersistence

public Persistence getPersistence(ClassDescriptor clsDesc,
                                  LogInterceptor logInterceptor)
            throws MappingException
Specified by:
getPersistence in interface PersistenceFactory

supportsSetNullInWhere

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

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