Class ReturningPolicy
- java.lang.Object
-
- org.eclipse.persistence.descriptors.ReturningPolicy
-
- All Implemented Interfaces:
Serializable,Cloneable
public class ReturningPolicy extends Object implements Serializable, Cloneable
Purpose: Allows for INSERT or UPDATE operations to return values back into the object being written. This allows for table default values, trigger or stored procedures computed values to be set back into the object. This can be used with generated SQL on the Oracle platform using the RETURNING clause, or through stored procedures on other platforms.
- Since:
- TopLink 10.1.3
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classReturningPolicy.InfoINTERNAL:
-
Constructor Summary
Constructors Constructor Description ReturningPolicy()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFieldForInsert(String qualifiedName)PUBLIC: Define that the field will be returned from an insert operation.voidaddFieldForInsert(String qualifiedName, Class type)PUBLIC: Define that the field will be returned from an insert operation.voidaddFieldForInsert(org.eclipse.persistence.internal.helper.DatabaseField field)PUBLIC: Define that the field will be returned from an insert operation.voidaddFieldForInsertReturnOnly(String qualifiedName)PUBLIC: Define that the field will be returned from an insert operation.voidaddFieldForInsertReturnOnly(String qualifiedName, Class type)PUBLIC: Define that the field will be returned from an insert operation.voidaddFieldForInsertReturnOnly(org.eclipse.persistence.internal.helper.DatabaseField field)PUBLIC: Define that the field will be returned from an insert operation.voidaddFieldForUpdate(String qualifiedName)PUBLIC: Define that the field will be returned from an update operation.voidaddFieldForUpdate(String qualifiedName, Class type)PUBLIC: Define that the field will be returned from an update operation.voidaddFieldForUpdate(org.eclipse.persistence.internal.helper.DatabaseField field)PUBLIC: Define that the field will be returned from an update operation.static booleanareCollectionsEqualAsSets(Collection col1, Collection col2)INTERNAL: Compares two Collections as sets (ignoring the order of the elements).Objectclone()INTERNAL: Normally cloned when not yet initialized.ClassDescriptorgetDescriptor()PUBLIC: Return the owner of the policy.org.eclipse.persistence.internal.helper.DatabaseFieldgetField(org.eclipse.persistence.internal.helper.DatabaseField field)INTERNAL: Returns an equal field held by ReturningPolicy, or null.List<ReturningPolicy.Info>getFieldInfos()INTERNAL:VectorgetFieldsToGenerateInsert(org.eclipse.persistence.internal.helper.DatabaseTable table)INTERNAL:VectorgetFieldsToGenerateUpdate(org.eclipse.persistence.internal.helper.DatabaseTable table)INTERNAL:Collection<org.eclipse.persistence.internal.helper.DatabaseField>getFieldsToMergeInsert()INTERNAL:Collection<org.eclipse.persistence.internal.helper.DatabaseField>getFieldsToMergeUpdate()INTERNAL:booleanhasEqualFieldInfos(List<ReturningPolicy.Info> infosToCompare)INTERNAL: Used for testing onlybooleanhasEqualFieldInfos(ReturningPolicy returningPolicyToCompare)INTERNAL: Used for testing onlybooleanhasEqualMains(ReturningPolicy policy)INTERNAL: Both ReturningPolicies should be initializedvoidinitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL:booleanisUsedToSetPrimaryKey()PUBLIC:voidsetDescriptor(ClassDescriptor descriptor)INTERNAL:voidsetFieldInfos(List<ReturningPolicy.Info> infos)INTERNAL:voidtrimModifyRowForInsert(org.eclipse.persistence.internal.sessions.AbstractRecord modifyRow)INTERNAL:voidvalidationAfterDescriptorInitialization(org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL:
-
-
-
Method Detail
-
getDescriptor
public ClassDescriptor getDescriptor()
PUBLIC: Return the owner of the policy.
-
getFieldsToGenerateInsert
public Vector getFieldsToGenerateInsert(org.eclipse.persistence.internal.helper.DatabaseTable table)
INTERNAL:
-
getFieldsToGenerateUpdate
public Vector getFieldsToGenerateUpdate(org.eclipse.persistence.internal.helper.DatabaseTable table)
INTERNAL:
-
getFieldInfos
public List<ReturningPolicy.Info> getFieldInfos()
INTERNAL:
-
setFieldInfos
public void setFieldInfos(List<ReturningPolicy.Info> infos)
INTERNAL:
-
hasEqualFieldInfos
public boolean hasEqualFieldInfos(ReturningPolicy returningPolicyToCompare)
INTERNAL: Used for testing only
-
hasEqualFieldInfos
public boolean hasEqualFieldInfos(List<ReturningPolicy.Info> infosToCompare)
INTERNAL: Used for testing only
-
areCollectionsEqualAsSets
public static boolean areCollectionsEqualAsSets(Collection col1, Collection col2)
INTERNAL: Compares two Collections as sets (ignoring the order of the elements). Note that the passed Collections are cloned. Used for testing only.
-
getFieldsToMergeInsert
public Collection<org.eclipse.persistence.internal.helper.DatabaseField> getFieldsToMergeInsert()
INTERNAL:
-
getFieldsToMergeUpdate
public Collection<org.eclipse.persistence.internal.helper.DatabaseField> getFieldsToMergeUpdate()
INTERNAL:
-
clone
public Object clone()
INTERNAL: Normally cloned when not yet initialized. If initialized ReturningPolicy cloned then the clone should be re-initialized.
-
setDescriptor
public void setDescriptor(ClassDescriptor descriptor)
INTERNAL:
-
addFieldForInsert
public void addFieldForInsert(String qualifiedName)
PUBLIC: Define that the field will be returned from an insert operation.
-
addFieldForInsert
public void addFieldForInsert(String qualifiedName, Class type)
PUBLIC: Define that the field will be returned from an insert operation. The type may be required to bind the output parameter if not known by the mapping.
-
addFieldForInsert
public void addFieldForInsert(org.eclipse.persistence.internal.helper.DatabaseField field)
PUBLIC: Define that the field will be returned from an insert operation.
-
addFieldForInsertReturnOnly
public void addFieldForInsertReturnOnly(String qualifiedName)
PUBLIC: Define that the field will be returned from an insert operation. A field added with addFieldForInsertReturnOnly method is excluded from INSERT clause during SQL generation.
-
addFieldForInsertReturnOnly
public void addFieldForInsertReturnOnly(String qualifiedName, Class type)
PUBLIC: Define that the field will be returned from an insert operation. A field added with addFieldForInsertReturnOnly method is excluded from INSERT clause during SQL generation. The type may be required to bind the output parameter if not known by the mapping.
-
addFieldForInsertReturnOnly
public void addFieldForInsertReturnOnly(org.eclipse.persistence.internal.helper.DatabaseField field)
PUBLIC: Define that the field will be returned from an insert operation. A field added with addFieldForInsertReturnOnly method is excluded from INSERT clause during SQL generation.
-
addFieldForUpdate
public void addFieldForUpdate(String qualifiedName)
PUBLIC: Define that the field will be returned from an update operation.
-
addFieldForUpdate
public void addFieldForUpdate(String qualifiedName, Class type)
PUBLIC: Define that the field will be returned from an update operation. The type may be required to bind the output parameter if not known by the mapping.
-
addFieldForUpdate
public void addFieldForUpdate(org.eclipse.persistence.internal.helper.DatabaseField field)
PUBLIC: Define that the field will be returned from an update operation.
-
initialize
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
-
hasEqualMains
public boolean hasEqualMains(ReturningPolicy policy)
INTERNAL: Both ReturningPolicies should be initialized
-
trimModifyRowForInsert
public void trimModifyRowForInsert(org.eclipse.persistence.internal.sessions.AbstractRecord modifyRow)
INTERNAL:
-
isUsedToSetPrimaryKey
public boolean isUsedToSetPrimaryKey()
PUBLIC:
-
validationAfterDescriptorInitialization
public void validationAfterDescriptorInitialization(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
-
getField
public org.eclipse.persistence.internal.helper.DatabaseField getField(org.eclipse.persistence.internal.helper.DatabaseField field)
INTERNAL: Returns an equal field held by ReturningPolicy, or null.
-
-