|
Oracle Application Server TopLink API Reference 10g Release 2 (10.1.2) B15903-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Purpose: Define an interface for sequencing customization.
Description: Customary sequencing behavior could be achieved by implementing this interface and passing the instance to DatabaseSession.getSequencingControl().setValueGenerationPolicy(..). TopLink internally uses the same method to set its default implementation of this interface, which provides native sequencing and table sequencing. Note that the following methods: shouldAcquireValueAfterInsert(); shouldUsePreallocation(); shouldUseSeparateConnection(); shouldUseTransaction(); are called only once - during creation of the sequencing object. Therefore during the lifetime of sequencing object these methods should return the same values as when called for the first time. If this is not true - resetSequencing (call SequencingControl.resetSequencing()).
Responsibilities:
SequencingControl
Method Summary | |
java.lang.Object |
getGeneratedValue(oracle.toplink.internal.databaseaccess.Accessor accessor, oracle.toplink.publicinterface.Session writeSession, java.lang.String seqName) ADVANCED: Return the newly-generated sequencing value. |
java.util.Vector |
getGeneratedVector(oracle.toplink.internal.databaseaccess.Accessor accessor, oracle.toplink.publicinterface.Session writeSession, java.lang.String seqName, int size) ADVANCED: Return a Vector of newly-generated sequencing values. |
void |
onConnect(oracle.toplink.publicinterface.DatabaseSession ownerSession) ADVANCED: This method is called when Sequencing object is created. |
void |
onDisconnect(oracle.toplink.publicinterface.DatabaseSession ownerSession) ADVANCED: This method is called when Sequencing object is destroyed.. |
boolean |
shouldAcquireValueAfterInsert() ADVANCED: Indicates whether sequencing value should be acquired after INSERT. |
boolean |
shouldOverrideExistingValue(java.lang.String seqName, java.lang.Object existingValue) ADVANCED: Indicates whether existing attribute value should be overridden. |
boolean |
shouldUsePreallocation() ADVANCED: Indicates whether several sequencing values should be acquired at a time and be kept by TopLink. |
boolean |
shouldUseSeparateConnection() ADVANCED: Indicates whether sequencing would rather use a separate sequencing connection. |
boolean |
shouldUseTransaction() ADVANCED: Indicates whether TopLink should internally call beginTransaction() before getGeneratedValue/Vector, and commitTransaction after. |
Method Detail |
public boolean shouldAcquireValueAfterInsert()
public boolean shouldUsePreallocation()
public boolean shouldUseSeparateConnection()
public boolean shouldUseTransaction()
public boolean shouldOverrideExistingValue(java.lang.String seqName, java.lang.Object existingValue)
seqName
- String is sequencing number field nameexistingValue
- Object is a non-null value of PK-mapped attribute.public java.lang.Object getGeneratedValue(oracle.toplink.internal.databaseaccess.Accessor accessor, oracle.toplink.publicinterface.Session writeSession, java.lang.String seqName)
accessor
- Accessor is a separate sequencing accessor (may be null);writeSession
- Session is a Session used for writing (either ClientSession or DatabaseSession);seqName
- String is sequencing number field namepublic java.util.Vector getGeneratedVector(oracle.toplink.internal.databaseaccess.Accessor accessor, oracle.toplink.publicinterface.Session writeSession, java.lang.String seqName, int size)
accessor
- Accessor is a separate sequencing accessor (may be null);writeSession
- Session is a Session used for writing (either ClientSession or DatabaseSession);seqName
- String is sequencing number field namesize
- int number of values to preallocate (output Vector size).public void onConnect(oracle.toplink.publicinterface.DatabaseSession ownerSession)
ownerSession
- DatabaseSessionpublic void onDisconnect(oracle.toplink.publicinterface.DatabaseSession ownerSession)
ownerSession
- DatabaseSession
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |