|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.castor.cpa.persistence.sql.keygen.HighLowKeyGenerator
public final class HighLowKeyGenerator
HIGH-LOW key generators.
HighLowKeyGeneratorFactory
Field Summary |
---|
Fields inherited from interface org.exolab.castor.persist.spi.KeyGenerator |
---|
AFTER_INSERT, BEFORE_INSERT, DURING_INSERT |
Constructor Summary | |
---|---|
HighLowKeyGenerator(PersistenceFactory factory,
java.util.Properties params,
int sqlType)
Initialize the HIGH-LOW key generator. |
Method Summary | |
---|---|
java.lang.Object |
generateKey(java.sql.Connection conn,
java.lang.String tableName,
java.lang.String primKeyName,
java.util.Properties props)
Generate a new key for the specified table. |
byte |
getStyle()
Style of the key generator: BEFORE_INSERT, DURING_INSERT or AFTER_INSERT. |
void |
initFromParameters(java.util.Properties params)
|
boolean |
isInSameConnection()
Is key generated in the same connection as INSERT? For DURING_INSERT style this method is never called. |
java.lang.String |
patchSQL(java.lang.String insert,
java.lang.String primKeyName)
Gives a possibility to patch the Castor-generated SQL statement for INSERT (indended mainly for DURING_INSERT style of key generators, other key generators usually simply return the passed parameter). |
void |
supportsSqlType(int sqlType)
Determine if the key generator supports a given sql type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HighLowKeyGenerator(PersistenceFactory factory, java.util.Properties params, int sqlType) throws MappingException
MappingException
Method Detail |
---|
public void initFromParameters(java.util.Properties params) throws MappingException
MappingException
public java.lang.Object generateKey(java.sql.Connection conn, java.lang.String tableName, java.lang.String primKeyName, java.util.Properties props) throws PersistenceException
generateKey
in interface KeyGenerator
conn
- An open connection within the given transactiontableName
- The table nameprimKeyName
- The primary key nameprops
- A temporary replacement for Principal object
PersistenceException
- An error occured talking to persistent
storagepublic void supportsSqlType(int sqlType) throws MappingException
supportsSqlType
in interface KeyGenerator
MappingException
public byte getStyle()
getStyle
in interface KeyGenerator
public boolean isInSameConnection()
isInSameConnection
in interface KeyGenerator
public java.lang.String patchSQL(java.lang.String insert, java.lang.String primKeyName)
patchSQL
in interface KeyGenerator
insert
- Castor-generated INSERT statementprimKeyName
- The primary key name
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |