BaseFactory
, DB2Factory
, DerbyFactory
, GenericFactory
, HsqlFactory
, InformixFactory
, InstantDBFactory
, InterbaseFactory
, MySQLFactory
, OracleFactory
, PointbaseFactory
, PostgreSQLFactory
, ProgressFactory
, SapDbFactory
, SQLServerFactory
, SybaseFactory
public interface PersistenceFactory
Persistence
)
as well as for constructing new query expressions (see QueryExpression
).
The factory is specified in the JDO configuration file for the database and is configured through Bean-like accessor methods.
Persistence
Modifier and Type | Method | Description |
---|---|---|
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).
|
java.lang.String |
getFactoryName() |
Returns the name of this factory.
|
java.lang.String |
getIdentitySelectString(java.lang.String tableName,
java.lang.String columnName) |
Returns the database specific query string for retrieving last identity value.
|
KeyGenerator |
getKeyGenerator(ClassDescriptor clsDesc) |
Returns a key generator as specified in the given class descriptor.
|
Persistence |
getPersistence(ClassDescriptor clsDesc) |
Returns a persistence implementation for the specified object
type (given its descriptor) on behalf of the specified cache
engine.
|
QueryExpression |
getQueryExpression() |
Returns a new empty query expression suitable for the underlying
SQL engine.
|
java.lang.String |
getSequenceAfterSelectString(java.lang.String seqName,
java.lang.String tableName) |
Returns the database specific SELECT query string
for fetching identity after the INSERT statement executed.
|
java.lang.String |
getSequenceBeforeSelectString(java.lang.String seqName,
java.lang.String tableName,
int increment) |
Returns the database specific SELECT query string
for fetching identity before the next INSERT statement gets executed.
|
java.lang.String |
getSequenceNextValString(java.lang.String seqName) |
Returns the database engine specific string to fetch sequence next value.
|
boolean |
isKeyGeneratorIdentitySupported() |
Does persistence factory support generation of unique keys with identity key generator?
|
boolean |
isKeyGeneratorIdentityTypeSupported(int type) |
Does identity key generator support generation of unique keys for the given SQL type?
|
boolean |
isKeyGeneratorSequenceSupported(boolean returning,
boolean trigger) |
Does persistence factory support generation of new key at the time of new
object creation with sequence key generator?
|
boolean |
isKeyGeneratorSequenceTypeSupported(int type) |
Does Sequence key generator support generation of key for the given SQL type?
|
java.lang.String |
quoteName(java.lang.String name) |
Returns the quoted identifier suitable for preventing conflicts between
database identifiers and reserved keywords.
|
java.lang.String getFactoryName()
KeyGenerator getKeyGenerator(ClassDescriptor clsDesc) throws MappingException
clsDesc
- The class descriptor.null
.MappingException
- If creation of key generator fails.Persistence getPersistence(ClassDescriptor clsDesc) throws MappingException
clsDesc
- The class descriptor.null
.MappingException
- Indicates that the object type is not supported by the persistence
engine due to improper mapping.QueryExpression getQueryExpression()
java.lang.String quoteName(java.lang.String name)
name
- The identifier (table, column, etc)java.lang.Class<?> adjustSqlType(java.lang.Class<?> sqlType)
sqlType
- The correspondent Java class for the SQL type in mapping.xmlPersistenceQuery getCallQuery(java.lang.String call, java.lang.Class<?>[] paramTypes, java.lang.Class<?> javaClass, java.lang.String[] fields, int[] sqlTypes)
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 typesboolean isKeyGeneratorIdentitySupported()
true
if persistence factory is able to generate unique keys with
identity key generator, false
otherwise.boolean isKeyGeneratorIdentityTypeSupported(int type)
type
- SQL type to check for support by identity key generator.true
if persistence factory is able to generate unique keys of
given SQL type with identity key generator, false
otherwise.java.lang.String getIdentitySelectString(java.lang.String tableName, java.lang.String columnName)
tableName
- Name of the table from which identity needs to be fetched.columnName
- Name of the column from which identity needs to be fetched.boolean isKeyGeneratorSequenceSupported(boolean returning, boolean trigger)
returning
- Return generated key value with insert statement?trigger
- Use a database trigger to generate key?true
if persistence factory is able to generate key with
sequence key generator, false
otherwise.boolean isKeyGeneratorSequenceTypeSupported(int type)
type
- SQL type to check for support by sequence key generator.true
if persistence factory is able to generate key of
given SQL type with sequence key generator, false
otherwise.java.lang.String getSequenceNextValString(java.lang.String seqName)
seqName
- Name of the sequence.java.lang.String getSequenceBeforeSelectString(java.lang.String seqName, java.lang.String tableName, int increment)
seqName
- Name of sequence.tableName
- Name of the table from which identity will be fetched.increment
- Increment value used in Interbase database engine.java.lang.String getSequenceAfterSelectString(java.lang.String seqName, java.lang.String tableName)
seqName
- Name of sequence.tableName
- Name of the table from which identity will be fetched.Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com