|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exolab.castor.jdo.keygen.IdentityKeyGenerator
public final class IdentityKeyGenerator
IDENTITY key generator.
IdentityKeyGeneratorFactory
Field Summary | |
---|---|
(package private) java.lang.String |
fName
|
Fields inherited from interface org.exolab.castor.persist.spi.KeyGenerator |
---|
AFTER_INSERT, BEFORE_INSERT, DURING_INSERT |
Constructor Summary | |
---|---|
IdentityKeyGenerator(PersistenceFactory factory,
int sqlType)
Initialize the IDENTITY 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 key generator: BEFORE_INSERT, DURING_INSERT or AFTER_INSERT ? |
boolean |
isInSameConnection()
Is key generated in the same connection as INSERT? |
java.lang.String |
patchSQL(java.lang.String insert,
java.lang.String primKeyName)
Gives a possibility to patch the Castor-generated SQL statement for INSERT (makes sense for DURING_INSERT key generators) |
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 |
Field Detail |
---|
java.lang.String fName
Constructor Detail |
---|
public IdentityKeyGenerator(PersistenceFactory factory, int sqlType) throws MappingException
factory
- A PersistenceFactory instance.sqlType
- A SQLTypidentifier.
MappingException
- if this key generator is not compatible with the persistance factory.Method Detail |
---|
public void supportsSqlType(int sqlType) throws MappingException
supportsSqlType
in interface KeyGenerator
sqlType
-
MappingException
public java.lang.Object generateKey(java.sql.Connection conn, java.lang.String tableName, java.lang.String primKeyName, java.util.Properties props) throws PersistenceException
KeyGenerator
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 final byte getStyle()
getStyle
in interface KeyGenerator
public boolean isInSameConnection()
isInSameConnection
in interface KeyGenerator
public final java.lang.String patchSQL(java.lang.String insert, java.lang.String primKeyName) throws MappingException
patchSQL
in interface KeyGenerator
insert
- Castor-generated INSERT statementprimKeyName
- The primary key name
MappingException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |