public class ReturningPolicy
extends java.lang.Object
implements java.io.Serializable, java.lang.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.
Modifier and Type | Class and Description |
---|---|
static class |
ReturningPolicy.Info
INTERNAL:
|
Constructor and Description |
---|
ReturningPolicy() |
Modifier and Type | Method and Description |
---|---|
void |
addFieldForInsert(DatabaseField field)
PUBLIC:
Define that the field will be returned from an insert operation.
|
void |
addFieldForInsert(java.lang.String qualifiedName)
PUBLIC:
Define that the field will be returned from an insert operation.
|
void |
addFieldForInsert(java.lang.String qualifiedName,
java.lang.Class type)
PUBLIC:
Define that the field will be returned from an insert operation.
|
void |
addFieldForInsertReturnOnly(DatabaseField field)
PUBLIC:
Define that the field will be returned from an insert operation.
|
void |
addFieldForInsertReturnOnly(java.lang.String qualifiedName)
PUBLIC:
Define that the field will be returned from an insert operation.
|
void |
addFieldForInsertReturnOnly(java.lang.String qualifiedName,
java.lang.Class type)
PUBLIC:
Define that the field will be returned from an insert operation.
|
void |
addFieldForUpdate(DatabaseField field)
PUBLIC:
Define that the field will be returned from an update operation.
|
void |
addFieldForUpdate(java.lang.String qualifiedName)
PUBLIC:
Define that the field will be returned from an update operation.
|
void |
addFieldForUpdate(java.lang.String qualifiedName,
java.lang.Class type)
PUBLIC:
Define that the field will be returned from an update operation.
|
static boolean |
areCollectionsEqualAsSets(java.util.Collection col1,
java.util.Collection col2)
INTERNAL:
Compares two Collections as sets (ignoring the order of the elements).
|
java.lang.Object |
clone()
INTERNAL:
Normally cloned when not yet initialized.
|
ClassDescriptor |
getDescriptor()
PUBLIC:
Return the owner of the policy.
|
DatabaseField |
getField(DatabaseField field)
INTERNAL:
Returns an equal field held by ReturningPolicy, or null.
|
java.util.List<ReturningPolicy.Info> |
getFieldInfos()
INTERNAL:
|
java.util.Vector |
getFieldsToGenerateInsert(DatabaseTable table)
INTERNAL:
|
java.util.Vector |
getFieldsToGenerateUpdate(DatabaseTable table)
INTERNAL:
|
java.util.Collection<DatabaseField> |
getFieldsToMergeInsert()
INTERNAL:
|
java.util.Collection<DatabaseField> |
getFieldsToMergeUpdate()
INTERNAL:
|
boolean |
hasEqualFieldInfos(java.util.List<ReturningPolicy.Info> infosToCompare)
INTERNAL:
Used for testing only
|
boolean |
hasEqualFieldInfos(ReturningPolicy returningPolicyToCompare)
INTERNAL:
Used for testing only
|
boolean |
hasEqualMains(ReturningPolicy policy)
INTERNAL:
Both ReturningPolicies should be initialized
|
void |
initialize(AbstractSession session)
INTERNAL:
|
boolean |
isUsedToSetPrimaryKey()
PUBLIC:
|
void |
setDescriptor(ClassDescriptor descriptor)
INTERNAL:
|
void |
setFieldInfos(java.util.List<ReturningPolicy.Info> infos)
INTERNAL:
|
void |
trimModifyRowForInsert(AbstractRecord modifyRow)
INTERNAL:
|
void |
validationAfterDescriptorInitialization(AbstractSession session)
INTERNAL:
|
public ClassDescriptor getDescriptor()
public java.util.Vector getFieldsToGenerateInsert(DatabaseTable table)
public java.util.Vector getFieldsToGenerateUpdate(DatabaseTable table)
public java.util.List<ReturningPolicy.Info> getFieldInfos()
public void setFieldInfos(java.util.List<ReturningPolicy.Info> infos)
public boolean hasEqualFieldInfos(ReturningPolicy returningPolicyToCompare)
public boolean hasEqualFieldInfos(java.util.List<ReturningPolicy.Info> infosToCompare)
public static boolean areCollectionsEqualAsSets(java.util.Collection col1, java.util.Collection col2)
public java.util.Collection<DatabaseField> getFieldsToMergeInsert()
public java.util.Collection<DatabaseField> getFieldsToMergeUpdate()
public java.lang.Object clone()
clone
in class java.lang.Object
public void setDescriptor(ClassDescriptor descriptor)
public void addFieldForInsert(java.lang.String qualifiedName)
public void addFieldForInsert(java.lang.String qualifiedName, java.lang.Class type)
public void addFieldForInsert(DatabaseField field)
public void addFieldForInsertReturnOnly(java.lang.String qualifiedName)
public void addFieldForInsertReturnOnly(java.lang.String qualifiedName, java.lang.Class type)
public void addFieldForInsertReturnOnly(DatabaseField field)
public void addFieldForUpdate(java.lang.String qualifiedName)
public void addFieldForUpdate(java.lang.String qualifiedName, java.lang.Class type)
public void addFieldForUpdate(DatabaseField field)
public void initialize(AbstractSession session)
public boolean hasEqualMains(ReturningPolicy policy)
public void trimModifyRowForInsert(AbstractRecord modifyRow)
public boolean isUsedToSetPrimaryKey()
public void validationAfterDescriptorInitialization(AbstractSession session)
public DatabaseField getField(DatabaseField field)
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference