Class BaseFactory
java.lang.Object
org.castor.cpa.persistence.sql.driver.BaseFactory
- All Implemented Interfaces:
PersistenceFactory
- Direct Known Subclasses:
GenericFactory
PersistenceFactory
for generic JDBC driver.- Version:
- $Revision: 8321 $ $Date: 2006-04-10 16:39:24 -0600 (Mon, 10 Apr 2006) $
- Author:
- Assaf Arkin, Bruce Snyder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClass<?>
adjustSqlType
(Class<?> sqlType) Some databases has some problems with some SQL types.getCallQuery
(String call, Class<?>[] paramTypes, Class<?> javaClass, String[] fields, int[] sqlTypes) Needed to process OQL queries of "CALL" type (using stored procedure call).getKeyGenerator
(ClassDescriptor clsDesc) Returns a key generator as specified in the given class descriptor.getPersistence
(ClassDescriptor clsDesc) Returns a persistence implementation for the specified object type (given its descriptor) on behalf of the specified cache engine.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, getIdentitySelectString, getQueryExpression, getSequenceAfterSelectString, getSequenceBeforeSelectString, getSequenceNextValString, isKeyGeneratorIdentitySupported, isKeyGeneratorIdentityTypeSupported, isKeyGeneratorSequenceSupported, isKeyGeneratorSequenceTypeSupported, quoteName
-
Constructor Details
-
BaseFactory
public BaseFactory()
-
-
Method Details
-
getKeyGenerator
Returns a key generator as specified in the given class descriptor.- Specified by:
getKeyGenerator
in interfacePersistenceFactory
- Parameters:
clsDesc
- The class descriptor.- Returns:
- A suitable key generator or
null
. - Throws:
MappingException
- If creation of key generator fails.
-
getPersistence
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 interfacePersistenceFactory
- Parameters:
clsDesc
- The class descriptor.- Returns:
- A suitable persistence implementation or
null
.
-
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.- Specified by:
getCallQuery
in interfacePersistenceFactory
- Parameters:
call
- Stored procedure call (without "{call")paramTypes
- The types of the query parametersjavaClass
- The Java class of the query resultsfields
- The field namessqlTypes
- The field SQL types- Returns:
- null if this feature is not supported.
-
adjustSqlType
Some databases has some problems with some SQL types. Usually it is enough to merely replace one SQL type by another.- Specified by:
adjustSqlType
in interfacePersistenceFactory
- 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.
-