FileDocCategorySizeDatePackage
Sequencing.javaAPI DocGlassfish v2 API4094Tue May 22 16:54:42 BST 2007oracle.toplink.essentials.internal.sequencing

Sequencing

public interface Sequencing

Purpose: Define interface to use sequencing.

Description: This interface accessed through Session.getSequencing() method. Used by TopLink internals to obtain sequencing values.

Responsibilities:

  • Provides sequencing objects and supporting APIs.

Fields Summary
public static final int
BEFORE_INSERT
public static final int
UNDEFINED
public static final int
AFTER_INSERT
Constructors Summary
Methods Summary
public java.lang.ObjectgetNextValue(java.lang.Class cls)
INTERNAL: Return the newly-generated sequencing value.

param
cls Class for which the sequencing value is generated.

public booleanshouldAcquireValueAfterInsert(java.lang.Class cls)
INTERNAL: Indicates whether sequencing value should be acqiured before or after INSERT

public booleanshouldOverrideExistingValue(java.lang.Class cls, java.lang.Object existingValue)
INTERNAL: Indicates whether existing attribute value should be overridden. This method is called in case an attribute mapped to PK of sequencing-using descriptor contains non-null value.

param
seqName String is sequencing number field name
param
existingValue Object is a non-null value of PK-mapped attribute.

public intwhenShouldAcquireValueForAll()
INTERNAL: Indicates when sequencing value should be acqiured for all classes. There are just three possible return values: BEFORE_INSERT, UNDEFINED, AFTER_INSERT. Used as a shortcut to avoid individual checks for each class: shouldAcquireValueAfterInsert(Class cls). Currently UNDEFINED only happens in a case of a SessionBroker: session1 - BEFORE_INSERT, session2 - AFTER_INSERT