|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.castor.cpa.persistence.sql.driver.BaseFactory
org.castor.cpa.persistence.sql.driver.GenericFactory
org.castor.cpa.persistence.sql.driver.SapDbFactory
public final class SapDbFactory
PersistenceFactory for SAP DB.
| Field Summary | |
|---|---|
static String |
FACTORY_NAME
|
| Constructor Summary | |
|---|---|
SapDbFactory()
|
|
| Method Summary | |
|---|---|
Class<?> |
adjustSqlType(Class<?> sqlType)
For INTEGER type ResultSet.getObject() returns BigDecimal: dependent objects with integer identity cause type conversion error (need to fix SimpleQueryExecutor). |
PersistenceQuery |
getCallQuery(String call,
Class<?>[] paramTypes,
Class<?> javaClass,
String[] fields,
int[] sqlTypes)
Needed to process OQL queries of "CALL" type (using stored procedure call). |
String |
getFactoryName()
Returns the name of this factory. |
String |
getIdentitySelectString(String tableName,
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. |
String |
getSequenceBeforeSelectString(String seqName,
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? |
String |
quoteName(String name)
Returns the quoted identifier suitable for preventing conflicts between database identifiers and reserved keywords. |
| Methods inherited from class org.castor.cpa.persistence.sql.driver.GenericFactory |
|---|
doubleQuoteName, getSequenceAfterSelectString, getSequenceNextValString |
| Methods inherited from class org.castor.cpa.persistence.sql.driver.BaseFactory |
|---|
getKeyGenerator, getPersistence |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String FACTORY_NAME
| Constructor Detail |
|---|
public SapDbFactory()
| Method Detail |
|---|
public String getFactoryName()
PersistenceFactory
getFactoryName in interface PersistenceFactorygetFactoryName in class GenericFactorypublic QueryExpression getQueryExpression()
PersistenceFactory
getQueryExpression in interface PersistenceFactorygetQueryExpression in class GenericFactorypublic String quoteName(String name)
PersistenceFactory
quoteName in interface PersistenceFactoryquoteName in class GenericFactoryname - The identifier (table, column, etc)
public PersistenceQuery getCallQuery(String call,
Class<?>[] paramTypes,
Class<?> javaClass,
String[] fields,
int[] sqlTypes)
getCallQuery in interface PersistenceFactorygetCallQuery in class BaseFactorycall - 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
public Class<?> adjustSqlType(Class<?> sqlType)
adjustSqlType in interface PersistenceFactoryadjustSqlType in class BaseFactorysqlType - The correspondent Java class for the SQL type in mapping.xml
public boolean isKeyGeneratorIdentitySupported()
GenericFactory
isKeyGeneratorIdentitySupported in interface PersistenceFactoryisKeyGeneratorIdentitySupported in class GenericFactorytrue if persistence factory is able to generate unique keys with
identity key generator, false otherwise.public boolean isKeyGeneratorIdentityTypeSupported(int type)
GenericFactory
isKeyGeneratorIdentityTypeSupported in interface PersistenceFactoryisKeyGeneratorIdentityTypeSupported in class GenericFactorytype - 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 String getIdentitySelectString(String tableName,
String columnName)
GenericFactory
getIdentitySelectString in interface PersistenceFactorygetIdentitySelectString in class GenericFactorytableName - 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 PersistenceFactoryisKeyGeneratorSequenceSupported in class GenericFactoryreturning - 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 PersistenceFactoryisKeyGeneratorSequenceTypeSupported in class GenericFactorytype - 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 String getSequenceBeforeSelectString(String seqName,
String tableName,
int increment)
GenericFactory
getSequenceBeforeSelectString in interface PersistenceFactorygetSequenceBeforeSelectString in class GenericFactoryseqName - Name of sequence.tableName - Name of the table from which identity will be fetched.increment - Increment value used in Interbase database engine.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||