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
| Modifier and Type | Field and Description |
|---|---|
| protected int | |
| protected int | |
| protected boolean | |
| protected String | |
| protected Platform | |
| protected String | |
| protected boolean | |
| protected int |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | |
| protected | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public Object | |
| public static boolean | |
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides java. |
| public Platform | |
| public abstract Object | getGeneratedValue(Accessor
Accessor is a separate sequencing accessor (may be null); accessor, AbstractSession Session is a Session used for writing (either ClientSession or DatabaseSession); writeSession, String String is sequencing number field name seqName)INTERNAL: Return the newly-generated sequencing value. |
| public Object | getGeneratedValue(Accessor
Accessor is a separate sequencing accessor (may be null); accessor, AbstractSession Session is a Session used for writing (either ClientSession or DatabaseSession); writeSession)INTERNAL: Return the newly-generated sequencing value. |
| public abstract Vector | getGeneratedVector(Accessor
Accessor is a separate sequencing accessor (may be null); accessor, AbstractSession Session is a Session used for writing (either ClientSession or DatabaseSession); writeSession, String String is sequencing number field name seqName, int int number of values to preallocate (output Vector size). size)INTERNAL: Return a Vector of newly-generated sequencing values. |
| public Vector | getGeneratedVector(Accessor
Accessor is a separate sequencing accessor (may be null); accessor, AbstractSession Session is a Session used for writing (either ClientSession or DatabaseSession); writeSession)INTERNAL: Return a Vector of newly-generated sequencing values. |
| public int | |
| public String | |
| public int | |
| public String | |
| public String | |
| public int | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public void | |
| public abstract void | |
| public void | |
| public abstract void | |
| protected void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | setShouldAlwaysOverrideExistingValue(boolean shouldAlwaysOverrideExistingValue)
ADVANCED: Set that to true if the sequence should always override the existing pk value. |
| public abstract boolean | shouldAcquireValueAfterInsert()
INTERNAL: Indicates whether sequencing value should be acquired after INSERT. |
| public boolean | shouldAlwaysOverrideExistingValue()
INTERNAL: Indicates whether the existing pk value should always be overridden by the sequence. |
| public boolean | shouldAlwaysOverrideExistingValue(String seqName)
INTERNAL: Indicates whether the existing pk value should always be overridden by the sequence. |
| public boolean | shouldUsePreallocation()
INTERNAL: Indicates whether several sequencing values should be acquired at a time and be kept by TopLink. |
| public abstract boolean | shouldUseTransaction()
INTERNAL: Indicates whether TopLink should internally call beginTransaction() before getGeneratedValue/Vector, and commitTransaction after. |
| public String | |
| protected void | verifyPlatform(Platform otherPlatform)
INTERNAL: Make sure that the sequence is not used by more than one platform. |
| depth | back to summary |
|---|---|
| protected int depth | |
| initialValue | back to summary |
|---|---|
| protected int initialValue | |
| isCustomQualifier | back to summary |
|---|---|
| protected boolean isCustomQualifier | |
| name | back to summary |
|---|---|
| protected String name | |
| platform | back to summary |
|---|---|
| protected Platform platform | |
| qualifier | back to summary |
|---|---|
| protected String qualifier | |
| shouldAlwaysOverrideExistingValue | back to summary |
|---|---|
| protected boolean shouldAlwaysOverrideExistingValue | |
| size | back to summary |
|---|---|
| protected int size | |
| Sequence | back to summary |
|---|---|
| protected Sequence() | |
| Sequence | back to summary |
|---|---|
| protected Sequence(String name) Create a new sequence with the name. | |
| Sequence | back to summary |
|---|---|
| protected Sequence(String name, int size) Create a new sequence with the name and sequence pre-allocation size. | |
| Sequence | back to summary |
|---|---|
| protected Sequence(String name, int size, int initialValue) | |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Doc from java. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by | |
| equalNameAndSize | back to summary |
|---|---|
| public static boolean equalNameAndSize(Sequence seq1, Sequence seq2) INTERNAL: Used in equals. | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getDatasourcePlatform | back to summary |
|---|---|
| public Platform getDatasourcePlatform() | |
| getGeneratedValue | back to summary |
|---|---|
| public abstract Object getGeneratedValue(Accessor accessor, AbstractSession writeSession, String seqName) INTERNAL: Return the newly-generated sequencing value. Used only in case preallocation is not used (shouldUsePreallocation()==false). Accessor may be non-null only in case shouldUseSeparateConnection()==true. Even in this case accessor could be null - if SequencingControl().shouldUseSeparateConnection()==false; Therefore in case shouldUseSeparateConnection()==true, implementation should handle both cases: use a separate connection if provided (accessor != null), or get by without it (accessor == null).
| |
| getGeneratedValue | back to summary |
|---|---|
| public Object getGeneratedValue(Accessor accessor, AbstractSession writeSession) INTERNAL: Return the newly-generated sequencing value. Used only in case preallocation is not used (shouldUsePreallocation()==false). Accessor may be non-null only in case shouldUseSeparateConnection()==true. Even in this case accessor could be null - if SequencingControl().shouldUseSeparateConnection()==false; Therefore in case shouldUseSeparateConnection()==true, implementation should handle both cases: use a separate connection if provided (accessor != null), or get by without it (accessor == null).
| |
| getGeneratedVector | back to summary |
|---|---|
| public abstract Vector INTERNAL: Return a Vector of newly-generated sequencing values. Used only in case preallocation is used (shouldUsePreallocation()==true). Accessor may be non-null only in case shouldUseSeparateConnection()==true. Even in this case accessor could be null - if SequencingControl().shouldUseSeparateConnection()==false; Therefore in case shouldUseSeparateConnection()==true, implementation should handle both cases: use a separate connection if provided (accessor != null), or get by without it (accessor == null).
| |
| getGeneratedVector | back to summary |
|---|---|
| public Vector INTERNAL: Return a Vector of newly-generated sequencing values. Used only in case preallocation is used (shouldUsePreallocation()==true). Accessor may be non-null only in case shouldUseSeparateConnection()==true. Even in this case accessor could be null - if SequencingControl().shouldUseSeparateConnection()==false; Therefore in case shouldUseSeparateConnection()==true, implementation should handle both cases: use a separate connection if provided (accessor != null), or get by without it (accessor == null).
| |
| getInitialValue | back to summary |
|---|---|
| public int getInitialValue() | |
| getName | back to summary |
|---|---|
| public String getName() | |
| getPreallocationSize | back to summary |
|---|---|
| public int getPreallocationSize() | |
| getQualified | back to summary |
|---|---|
| public String getQualified(String str) INTERNAL: | |
| getQualifier | back to summary |
|---|---|
| public String getQualifier() INTERNAL: | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isConnected | back to summary |
|---|---|
| public boolean isConnected() PUBLIC: Indicates that Sequence is connected. | |
| isCustomQualifier | back to summary |
|---|---|
| public boolean isCustomQualifier() INTERNAL: | |
| isNative | back to summary |
|---|---|
| public boolean isNative() | |
| isTable | back to summary |
|---|---|
| public boolean isTable() | |
| isUnaryTable | back to summary |
|---|---|
| public boolean isUnaryTable() | |
| onConnect | back to summary |
|---|---|
| public void onConnect(Platform platform) INTERNAL: This method is called when Sequencing object is created. Don't override this method. | |
| onConnect | back to summary |
|---|---|
| public abstract void onConnect() INTERNAL: This method is called when Sequencing object is created. If it requires initialization, subclass should override this method. | |
| onDisconnect | back to summary |
|---|---|
| public void onDisconnect(Platform platform) INTERNAL: This method is called when Sequencing object is destroyed. Don't override this method. | |
| onDisconnect | back to summary |
|---|---|
| public abstract void onDisconnect() INTERNAL: This method is called when Sequencing object is destroyed. If it requires deinitialization, subclass should override this method. | |
| setDatasourcePlatform | back to summary |
|---|---|
| protected void setDatasourcePlatform(Platform platform) | |
| setInitialValue | back to summary |
|---|---|
| public void setInitialValue(int initialValue) | |
| setName | back to summary |
|---|---|
| public void setName(String name) | |
| setPreallocationSize | back to summary |
|---|---|
| public void setPreallocationSize(int size) | |
| setQualifier | back to summary |
|---|---|
| public void setQualifier(String qualifier) INTERNAL: | |
| setShouldAlwaysOverrideExistingValue | back to summary |
|---|---|
| public void setShouldAlwaysOverrideExistingValue(boolean shouldAlwaysOverrideExistingValue) ADVANCED: Set that to true if the sequence should always override the existing pk value. | |
| shouldAcquireValueAfterInsert | back to summary |
|---|---|
| public abstract boolean shouldAcquireValueAfterInsert() INTERNAL: Indicates whether sequencing value should be acquired after INSERT. Note that preallocation could be used only in case sequencing values should be acquired before insert (this method returns false). In default implementation, it is true for table sequencing and native sequencing on Oracle platform, false for native sequencing on other platforms. | |
| shouldAlwaysOverrideExistingValue | back to summary |
|---|---|
| public boolean shouldAlwaysOverrideExistingValue() INTERNAL: Indicates whether the existing pk value should always be overridden by the sequence. As always the version of the method taking seqName is provided for the benefit of DefaultSequence. | |
| shouldAlwaysOverrideExistingValue | back to summary |
|---|---|
| public boolean shouldAlwaysOverrideExistingValue(String seqName) INTERNAL: Indicates whether the existing pk value should always be overridden by the sequence. | |
| shouldUsePreallocation | back to summary |
|---|---|
| public boolean shouldUsePreallocation() INTERNAL: Indicates whether several sequencing values should be acquired at a time and be kept by TopLink. This in only possible in case sequencing numbers should be acquired before insert (shouldAcquireValueAfterInsert()==false). In default implementation, it is true for table sequencing and native sequencing on Oracle platform, false for native sequencing on other platforms. | |
| shouldUseTransaction | back to summary |
|---|---|
| public abstract boolean shouldUseTransaction() INTERNAL: Indicates whether TopLink should internally call beginTransaction() before getGeneratedValue/Vector, and commitTransaction after. In default implementation, it is true for table sequencing and false for native sequencing. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| verifyPlatform | back to summary |
|---|---|
| protected void verifyPlatform(Platform otherPlatform) INTERNAL: Make sure that the sequence is not used by more than one platform. | |