|
EclipseLink 2.2.0, build 'v20110202-r8913' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.persistence.sequencing.Sequence
public abstract class Sequence
Purpose: Abstract class to define sequencing.
Description A sequence defines how generated ids are obtained. The main sequence types are TableSequence and NativeSequence. Descriptors using sequencing will use the sequence object defined in their session's DatabaseLogin with the name matching their sequence name. If a specific sequence is not defined for the name the DatabaseLogin's default sequence will be used.
TableSequence
,
NativeSequence
,
Serialized FormField Summary | |
---|---|
protected int |
depth
|
protected int |
initialValue
|
protected boolean |
isCustomQualifier
|
protected java.lang.String |
name
|
protected org.eclipse.persistence.internal.databaseaccess.Platform |
platform
|
protected java.lang.String |
qualifier
|
protected boolean |
shouldAlwaysOverrideExistingValue
|
protected int |
size
|
Constructor Summary | |
---|---|
Sequence()
|
|
Sequence(java.lang.String name)
Create a new sequence with the name. |
|
Sequence(java.lang.String name,
int size)
Create a new sequence with the name and sequence pre-allocation size. |
|
Sequence(java.lang.String name,
int size,
int initialValue)
|
Method Summary | |
---|---|
java.lang.Object |
clone()
|
static boolean |
equalNameAndSize(Sequence seq1,
Sequence seq2)
INTERNAL: Used in equals. |
boolean |
equals(java.lang.Object obj)
|
org.eclipse.persistence.internal.databaseaccess.Platform |
getDatasourcePlatform()
|
java.lang.Object |
getGeneratedValue(org.eclipse.persistence.internal.databaseaccess.Accessor accessor,
org.eclipse.persistence.internal.sessions.AbstractSession writeSession)
INTERNAL: Return the newly-generated sequencing value. |
abstract java.lang.Object |
getGeneratedValue(org.eclipse.persistence.internal.databaseaccess.Accessor accessor,
org.eclipse.persistence.internal.sessions.AbstractSession writeSession,
java.lang.String seqName)
INTERNAL: Return the newly-generated sequencing value. |
java.util.Vector |
getGeneratedVector(org.eclipse.persistence.internal.databaseaccess.Accessor accessor,
org.eclipse.persistence.internal.sessions.AbstractSession writeSession)
INTERNAL: Return a Vector of newly-generated sequencing values. |
abstract java.util.Vector |
getGeneratedVector(org.eclipse.persistence.internal.databaseaccess.Accessor accessor,
org.eclipse.persistence.internal.sessions.AbstractSession writeSession,
java.lang.String seqName,
int size)
INTERNAL: Return a Vector of newly-generated sequencing values. |
int |
getInitialValue()
|
java.lang.String |
getName()
|
int |
getPreallocationSize()
|
java.lang.String |
getQualified(java.lang.String str)
INTERNAL: |
java.lang.String |
getQualifier()
INTERNAL: |
boolean |
isConnected()
PUBLIC: Indicates that Sequence is connected. |
boolean |
isCustomQualifier()
INTERNAL: |
boolean |
isNative()
|
boolean |
isTable()
|
boolean |
isUnaryTable()
|
abstract void |
onConnect()
INTERNAL: This method is called when Sequencing object is created. |
void |
onConnect(org.eclipse.persistence.internal.databaseaccess.Platform platform)
INTERNAL: This method is called when Sequencing object is created. |
abstract void |
onDisconnect()
INTERNAL: This method is called when Sequencing object is destroyed. |
void |
onDisconnect(org.eclipse.persistence.internal.databaseaccess.Platform platform)
INTERNAL: This method is called when Sequencing object is destroyed. |
protected void |
setDatasourcePlatform(org.eclipse.persistence.internal.databaseaccess.Platform platform)
|
void |
setInitialValue(int initialValue)
|
void |
setName(java.lang.String name)
|
void |
setPreallocationSize(int size)
|
void |
setQualifier(java.lang.String qualifier)
INTERNAL: |
void |
setShouldAlwaysOverrideExistingValue(boolean shouldAlwaysOverrideExistingValue)
ADVANCED: Set that to true if the sequence should always override the existing pk value. |
abstract boolean |
shouldAcquireValueAfterInsert()
INTERNAL: Indicates whether sequencing value should be acquired after INSERT. |
boolean |
shouldAlwaysOverrideExistingValue()
INTERNAL: Indicates whether the existing pk value should always be overridden by the sequence. |
boolean |
shouldAlwaysOverrideExistingValue(java.lang.String seqName)
INTERNAL: Indicates whether the existing pk value should always be overridden by the sequence. |
boolean |
shouldUsePreallocation()
INTERNAL: Indicates whether several sequencing values should be acquired at a time and be kept by TopLink. |
abstract boolean |
shouldUseTransaction()
INTERNAL: Indicates whether TopLink should internally call beginTransaction() before getGeneratedValue/Vector, and commitTransaction after. |
java.lang.String |
toString()
|
protected void |
verifyPlatform(org.eclipse.persistence.internal.databaseaccess.Platform otherPlatform)
INTERNAL: Make sure that the sequence is not used by more than one platform. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.String name
protected int size
protected org.eclipse.persistence.internal.databaseaccess.Platform platform
protected int initialValue
protected int depth
protected java.lang.String qualifier
protected boolean isCustomQualifier
protected boolean shouldAlwaysOverrideExistingValue
Constructor Detail |
---|
public Sequence()
public Sequence(java.lang.String name)
public Sequence(java.lang.String name, int size)
public Sequence(java.lang.String name, int size, int initialValue)
Method Detail |
---|
public boolean isNative()
public boolean isTable()
public boolean isUnaryTable()
public java.lang.String getName()
public void setName(java.lang.String name)
public int getPreallocationSize()
public void setPreallocationSize(int size)
public int getInitialValue()
public void setInitialValue(int initialValue)
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public static boolean equalNameAndSize(Sequence seq1, Sequence seq2)
protected void setDatasourcePlatform(org.eclipse.persistence.internal.databaseaccess.Platform platform)
public org.eclipse.persistence.internal.databaseaccess.Platform getDatasourcePlatform()
public abstract boolean shouldAcquireValueAfterInsert()
public boolean shouldUsePreallocation()
public abstract boolean shouldUseTransaction()
public abstract java.lang.Object getGeneratedValue(org.eclipse.persistence.internal.databaseaccess.Accessor accessor, org.eclipse.persistence.internal.sessions.AbstractSession 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.lang.Object getGeneratedValue(org.eclipse.persistence.internal.databaseaccess.Accessor accessor, org.eclipse.persistence.internal.sessions.AbstractSession writeSession)
accessor
- Accessor is a separate sequencing accessor (may be null);writeSession
- Session is a Session used for writing (either ClientSession or DatabaseSession);public abstract java.util.Vector getGeneratedVector(org.eclipse.persistence.internal.databaseaccess.Accessor accessor, org.eclipse.persistence.internal.sessions.AbstractSession 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 java.util.Vector getGeneratedVector(org.eclipse.persistence.internal.databaseaccess.Accessor accessor, org.eclipse.persistence.internal.sessions.AbstractSession writeSession)
accessor
- Accessor is a separate sequencing accessor (may be null);writeSession
- Session is a Session used for writing (either ClientSession or DatabaseSession);public void onConnect(org.eclipse.persistence.internal.databaseaccess.Platform platform)
public abstract void onConnect()
public void onDisconnect(org.eclipse.persistence.internal.databaseaccess.Platform platform)
public abstract void onDisconnect()
public boolean isConnected()
protected void verifyPlatform(org.eclipse.persistence.internal.databaseaccess.Platform otherPlatform)
public void setQualifier(java.lang.String qualifier)
public boolean isCustomQualifier()
public java.lang.String getQualifier()
public java.lang.String getQualified(java.lang.String str)
public void setShouldAlwaysOverrideExistingValue(boolean shouldAlwaysOverrideExistingValue)
public boolean shouldAlwaysOverrideExistingValue()
public boolean shouldAlwaysOverrideExistingValue(java.lang.String seqName)
public java.lang.String toString()
toString
in class java.lang.Object
|
EclipseLink 2.2.0, build 'v20110202-r8913' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |