ilog.rules.teamserver.model
Class IlrCommitableObject
- java.lang.Object
-
- ilog.rules.teamserver.model.IlrCommitableObject
-
- All Implemented Interfaces:
- ilog.rules.teamserver.model.IlrCompositeObject, java.io.Serializable
public class IlrCommitableObject extends java.lang.Object implements java.io.Serializable, ilog.rules.teamserver.model.IlrCompositeObject
Holds an element to commit in the database along with its details and/or a list of its contained elements to add or delete during the commit.This allows you to commit a complete root element, that is, its details and its contained elements (elements in relationship with the root element through a containment reference
EReference.isContainment()
).
-
-
Constructor Summary
Constructors Constructor and Description IlrCommitableObject(IlrElementHandle rootElement)
Creates a commitable object.
-
Method Summary
Methods Modifier and Type Method and Description void
addDeletedElement(org.eclipse.emf.ecore.EReference reference, IlrElementDetails containedDetails)
Adds a contained element to delete upon commit.void
addModifiedElement(org.eclipse.emf.ecore.EReference reference, IlrElementDetails containedDetails)
Adds a contained element to commit together with the root element.boolean
equals(java.lang.Object o)
Indicates whether some other committable object is "equal to" this one.java.lang.String
getComment()
Gets the comment that will be associated with the commit.java.lang.Object
getDeletedElement(org.eclipse.emf.ecore.EReference reference)
Deprecated.: use getMonoValuedDeletedElement or getMultiValuedDeletedElement instead. Gets the contained element or the set of contained elements to delete.IlrElementDetails
getDetails()
java.lang.Object
getFromReference(org.eclipse.emf.ecore.EReference reference)
java.lang.Object
getModifiedElement(org.eclipse.emf.ecore.EReference reference)
Deprecated.: use getMonoValuedModifiedElement or getMultiValuedModifiedElement instead. Gets the contained element or the set of contained elements to commit together with the root element.IlrElementDetails
getMonoValuedDeletedElement(org.eclipse.emf.ecore.EReference reference)
Gets the contained element for given reference to delete.IlrElementDetails
getMonoValuedFromReference(org.eclipse.emf.ecore.EReference reference)
IlrElementDetails
getMonoValuedModifiedElement(org.eclipse.emf.ecore.EReference reference)
Gets the contained element for given reference to commit together with the root element.java.util.Set<IlrElementDetails>
getMultiValuedDeletedElement(org.eclipse.emf.ecore.EReference reference)
Gets the set of contained element for given reference to delete.java.util.List<IlrElementDetails>
getMultiValuedFromReference(org.eclipse.emf.ecore.EReference reference)
java.util.Set<IlrElementDetails>
getMultiValuedModifiedElement(org.eclipse.emf.ecore.EReference reference)
Gets the set of contained elements for given reference to commit together with the root element.IlrElementDetails
getRootDetails()
Gets the details to commit for the root elementIlrElementHandle
getRootElementHandle()
Gets the handle on the root element to commit.int
hashCode()
boolean
isUpdateMajorVersion()
Indicates whether the commit must update the major version of the element or not.void
setComment(java.lang.String comment)
Sets the comment that will be associated with the commit.void
setRootDetails(IlrElementDetails rootDetails)
Sets the details to commit for the root element.void
setUpdateMajorVersion(boolean updateMajorVersion)
Deprecated.should customize IlrSessionController.getNextVersion(). Indicates whether the commit must update the major version of the element or not.
-
-
-
Constructor Detail
-
IlrCommitableObject
public IlrCommitableObject(IlrElementHandle rootElement)
Creates a commitable object.- Parameters:
rootElement
- Handle on the root element that is going to be committed.
-
-
Method Detail
-
getRootElementHandle
public IlrElementHandle getRootElementHandle()
Gets the handle on the root element to commit.- Returns:
- A handle on the root element.
-
getComment
public java.lang.String getComment()
Gets the comment that will be associated with the commit.- Returns:
- A string, or null if no comment has been set.
-
setComment
public void setComment(java.lang.String comment)
Sets the comment that will be associated with the commit.- Parameters:
comment
- Any string.
-
isUpdateMajorVersion
public boolean isUpdateMajorVersion()
Indicates whether the commit must update the major version of the element or not.- Returns:
- True if the major version will be updated. If false, the minor version will be updated instead. By default, this method returns false.
-
setUpdateMajorVersion
public void setUpdateMajorVersion(boolean updateMajorVersion)
Deprecated. should customize IlrSessionController.getNextVersion(). Indicates whether the commit must update the major version of the element or not.- Parameters:
updateMajorVersion
- True if the major version needs to be updated; false to update the minor version.
-
setRootDetails
public void setRootDetails(IlrElementDetails rootDetails)
Sets the details to commit for the root element.- Parameters:
rootDetails
- TheIlrElementDetails
to commit.
-
getRootDetails
public IlrElementDetails getRootDetails()
Gets the details to commit for the root element- Returns:
IlrElementDetails
to commit.
-
getDeletedElement
public java.lang.Object getDeletedElement(org.eclipse.emf.ecore.EReference reference)
Deprecated. : use getMonoValuedDeletedElement or getMultiValuedDeletedElement instead. Gets the contained element or the set of contained elements to delete.- Parameters:
reference
- A containment reference (EReference.isContainment()
).- Returns:
- An
IlrElementDetails
if the reference is unary or a set ofIlrElementDetails
otherwise (ETypedElement.isMany()
).
-
getMonoValuedDeletedElement
public IlrElementDetails getMonoValuedDeletedElement(org.eclipse.emf.ecore.EReference reference)
Gets the contained element for given reference to delete.- Parameters:
reference
- An unary containment reference (EReference.isContainment()
).- Returns:
- An
IlrElementDetails
if the reference is unary or a set ofIlrElementDetails
otherwise (ETypedElement.isMany()
).
-
getMultiValuedDeletedElement
public java.util.Set<IlrElementDetails> getMultiValuedDeletedElement(org.eclipse.emf.ecore.EReference reference)
Gets the set of contained element for given reference to delete.- Parameters:
reference
- A multi-valued containment reference (EReference.isContainment()
).- Returns:
- An
IlrElementDetails
if the reference is unary or a set ofIlrElementDetails
otherwise (ETypedElement.isMany()
).
-
getModifiedElement
public java.lang.Object getModifiedElement(org.eclipse.emf.ecore.EReference reference)
Deprecated. : use getMonoValuedModifiedElement or getMultiValuedModifiedElement instead. Gets the contained element or the set of contained elements to commit together with the root element.- Parameters:
reference
- A containment reference (EReference.isContainment()
).- Returns:
- An
IlrElementDetails
if the reference is unary or a set ofIlrElementDetails
otherwise (ETypedElement.isMany()
).
-
getMonoValuedModifiedElement
public IlrElementDetails getMonoValuedModifiedElement(org.eclipse.emf.ecore.EReference reference)
Gets the contained element for given reference to commit together with the root element.- Parameters:
reference
- An unary containment reference (EReference.isContainment()
).- Returns:
- An
IlrElementDetails
if the reference is unary or a set ofIlrElementDetails
otherwise (ETypedElement.isMany()
).
-
getMultiValuedModifiedElement
public java.util.Set<IlrElementDetails> getMultiValuedModifiedElement(org.eclipse.emf.ecore.EReference reference)
Gets the set of contained elements for given reference to commit together with the root element.- Parameters:
reference
- A multi-valued containment reference (EReference.isContainment()
).- Returns:
- A set of
IlrElementDetails
otherwise (ETypedElement.isMany()
).
-
addModifiedElement
public void addModifiedElement(org.eclipse.emf.ecore.EReference reference, IlrElementDetails containedDetails)
Adds a contained element to commit together with the root element.- Parameters:
reference
- A containment reference (EReference.isContainment()
).containedDetails
- Details of the contained element to commit.
-
addDeletedElement
public void addDeletedElement(org.eclipse.emf.ecore.EReference reference, IlrElementDetails containedDetails)
Adds a contained element to delete upon commit.- Parameters:
reference
- A containment reference (EReference.isContainment()
).containedDetails
- Details of the contained element to delete upon commit.
-
equals
public boolean equals(java.lang.Object o)
Indicates whether some other committable object is "equal to" this one.- Overrides:
equals
in classjava.lang.Object
- Parameters:
o
- The object to compare with this.- Returns:
- true If both committable objects reference the same element handle.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getDetails
public IlrElementDetails getDetails()
- Specified by:
getDetails
in interfaceilog.rules.teamserver.model.IlrCompositeObject
-
getFromReference
public java.lang.Object getFromReference(org.eclipse.emf.ecore.EReference reference)
- Specified by:
getFromReference
in interfaceilog.rules.teamserver.model.IlrCompositeObject
-
getMonoValuedFromReference
public IlrElementDetails getMonoValuedFromReference(org.eclipse.emf.ecore.EReference reference)
-
getMultiValuedFromReference
public java.util.List<IlrElementDetails> getMultiValuedFromReference(org.eclipse.emf.ecore.EReference reference)
-
-