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()).

    See Also:
    IlrSession.commit(IlrCommitableObject), Serialized Form
    • 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 - The IlrElementDetails 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 of IlrElementDetails 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 of IlrElementDetails 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 of IlrElementDetails 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 of IlrElementDetails 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 of IlrElementDetails 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 class java.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 class java.lang.Object
      • getDetails

        public IlrElementDetails getDetails()
        Specified by:
        getDetails in interface ilog.rules.teamserver.model.IlrCompositeObject
      • getFromReference

        public java.lang.Object getFromReference(org.eclipse.emf.ecore.EReference reference)
        Specified by:
        getFromReference in interface ilog.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)

© Copyright IBM Corp. 1987, 2015