PersistenceFactory
public final class SapDbFactory extends GenericFactory
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
FACTORY_NAME |
Constructor | Description |
---|---|
SapDbFactory() |
Modifier and Type | Method | Description |
---|---|---|
java.lang.Class<?> |
adjustSqlType(java.lang.Class<?> sqlType) |
For INTEGER type ResultSet.getObject() returns BigDecimal:
dependent objects with integer identity cause type conversion error
(need to fix SimpleQueryExecutor).
|
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.
|
QueryExpression |
getQueryExpression() |
Returns a new empty query expression suitable for the underlying
SQL engine.
|
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.
|
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.
|
getKeyGenerator, getPersistence
doubleQuoteName, getSequenceAfterSelectString, getSequenceNextValString
public static final java.lang.String FACTORY_NAME
public java.lang.String getFactoryName()
PersistenceFactory
getFactoryName
in interface PersistenceFactory
getFactoryName
in class GenericFactory
public QueryExpression getQueryExpression()
PersistenceFactory
getQueryExpression
in interface PersistenceFactory
getQueryExpression
in class GenericFactory
public java.lang.String quoteName(java.lang.String name)
PersistenceFactory
quoteName
in interface PersistenceFactory
quoteName
in class GenericFactory
name
- The identifier (table, column, etc)public PersistenceQuery getCallQuery(java.lang.String call, java.lang.Class<?>[] paramTypes, java.lang.Class<?> javaClass, java.lang.String[] fields, int[] sqlTypes)
getCallQuery
in interface PersistenceFactory
getCallQuery
in class BaseFactory
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 typespublic java.lang.Class<?> adjustSqlType(java.lang.Class<?> sqlType)
adjustSqlType
in interface PersistenceFactory
adjustSqlType
in class BaseFactory
sqlType
- The correspondent Java class for the SQL type in mapping.xmlpublic boolean isKeyGeneratorIdentitySupported()
GenericFactory
isKeyGeneratorIdentitySupported
in interface PersistenceFactory
isKeyGeneratorIdentitySupported
in class GenericFactory
true
if persistence factory is able to generate unique keys with
identity key generator, false
otherwise.public boolean isKeyGeneratorIdentityTypeSupported(int type)
GenericFactory
isKeyGeneratorIdentityTypeSupported
in interface PersistenceFactory
isKeyGeneratorIdentityTypeSupported
in class GenericFactory
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.public java.lang.String getIdentitySelectString(java.lang.String tableName, java.lang.String columnName)
GenericFactory
getIdentitySelectString
in interface PersistenceFactory
getIdentitySelectString
in class GenericFactory
tableName
- Name of the table from which identity needs to be fetched.columnName
- Name of the column from which identity needs to be fetched.public boolean isKeyGeneratorSequenceSupported(boolean returning, boolean trigger)
GenericFactory
isKeyGeneratorSequenceSupported
in interface PersistenceFactory
isKeyGeneratorSequenceSupported
in class GenericFactory
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.public boolean isKeyGeneratorSequenceTypeSupported(int type)
isKeyGeneratorSequenceTypeSupported
in interface PersistenceFactory
isKeyGeneratorSequenceTypeSupported
in class GenericFactory
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.public java.lang.String getSequenceBeforeSelectString(java.lang.String seqName, java.lang.String tableName, int increment)
GenericFactory
getSequenceBeforeSelectString
in interface PersistenceFactory
getSequenceBeforeSelectString
in class GenericFactory
seqName
- Name of sequence.tableName
- Name of the table from which identity will be fetched.increment
- Increment value used in Interbase database engine.Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com