Class InstantDBFactory
java.lang.Object
org.castor.cpa.persistence.sql.driver.BaseFactory
org.castor.cpa.persistence.sql.driver.GenericFactory
org.castor.cpa.persistence.sql.driver.InstantDBFactory
- All Implemented Interfaces:
PersistenceFactory
Persistence factory for InstantDB database (http://instantdb.enhydra.org/ ).
Example database.xml
file for JDO
<database name="test" engine="instantdb" > <driver class-name="org.enhydra.instantdb.jdbc.idbDriver" url="jdbc:idb:C:\\castor-0.8.8\\db\\test\\test.prp"> <param name="user" value="" /> <param name="password" value="" /> </driver> <mapping href="mapping.xml" /> </database>
- Version:
- 1.0
- Author:
- I. Burak Ozyurt
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClass
<?> adjustSqlType
(Class<?> sqlType) For NUMERIC type ResultSet.getObject() returns Double instead of BigDecimal for InstantDB.getCallQuery
(String call, Class<?>[] paramTypes, Class<?> javaClass, String[] fields, int[] sqlTypes) Needed to process OQL queries of "CALL" type (using stored procedure call).Returns the name of this factory.Returns a new empty query expression suitable for the underlying SQL engine.Methods inherited from class org.castor.cpa.persistence.sql.driver.GenericFactory
doubleQuoteName, getIdentitySelectString, getSequenceAfterSelectString, getSequenceBeforeSelectString, getSequenceNextValString, isKeyGeneratorIdentitySupported, isKeyGeneratorIdentityTypeSupported, isKeyGeneratorSequenceSupported, isKeyGeneratorSequenceTypeSupported, quoteName
Methods inherited from class org.castor.cpa.persistence.sql.driver.BaseFactory
getKeyGenerator, getPersistence
-
Field Details
-
FACTORY_NAME
- See Also:
-
-
Constructor Details
-
InstantDBFactory
public InstantDBFactory()
-
-
Method Details
-
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 interfacePersistenceFactory
- Overrides:
getFactoryName
in classGenericFactory
- Returns:
- The name of this factory
-
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 interfacePersistenceFactory
- Overrides:
getQueryExpression
in classGenericFactory
- Returns:
- New empty query expression
-
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
- Overrides:
getCallQuery
in classBaseFactory
- 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
For NUMERIC type ResultSet.getObject() returns Double instead of BigDecimal for InstantDB.- Specified by:
adjustSqlType
in interfacePersistenceFactory
- Overrides:
adjustSqlType
in classBaseFactory
- 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.
-