Class PersistenceFieldElement

    • Field Detail

      • PERSISTENT

        public static final int PERSISTENT
        Constant representing a persistent field modifier.
        See Also:
        Constant Field Values
      • DERIVED

        public static final int DERIVED
        Constant representing a derived field modifier.
        See Also:
        Constant Field Values
      • TRANSIENT

        public static final int TRANSIENT
        Constant representing a transient field modifier. This constant is only here for comparison purposes, it will not be returned by getPersistenceType since there will be no instance of this class for transient fields.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PersistenceFieldElement

        public PersistenceFieldElement()
        Create new PersistenceFieldElement with no implementation. This constructor should only be used for cloning and archiving.
      • PersistenceFieldElement

        public PersistenceFieldElement​(PersistenceFieldElement.Impl impl,
                                       PersistenceClassElement declaringClass)
        Create new PersistenceFieldElement with the provided implementation. The implementation is responsible for storing all properties of the object.
        Parameters:
        impl - the implementation to use
        declaringClass - the class to attach to
    • Method Detail

      • getPersistenceType

        public int getPersistenceType()
        Get the persistence type of this field element.
        Returns:
        the persistence type, one of PERSISTENT or DERIVED
      • setPersistenceType

        public void setPersistenceType​(int type)
                                throws ModelException
        Set the persistence type of this field element.
        Parameters:
        type - - an integer indicating the persistence type, one of: PERSISTENT or DERIVED
        Throws:
        ModelException - if impossible
      • isReadSensitive

        public boolean isReadSensitive()
        Determines whether this field element is read sensitive or not. This value is only used if getPersistenceType returns DERIVED
        Returns:
        true if the field is read sensitive, false if it is not or if the persistence type is not derived
        See Also:
        isWriteSensitive(), setPersistenceType(int), DERIVED
      • setReadSensitive

        public void setReadSensitive​(boolean flag)
                              throws ModelException
        Set whether this field element is read sensitive or not.
        Parameters:
        flag - - if true and this is a derived field, the field element is marked as read sensitive; otherwise, it is not This value is only used if getPersistenceType returns DERIVED
        Throws:
        ModelException - if impossible
        See Also:
        setWriteSensitive(boolean), setPersistenceType(int), DERIVED
      • isWriteSensitive

        public boolean isWriteSensitive()
        Determines whether this field element is write sensitive or not. This value is only used if getPersistenceType returns DERIVED
        Returns:
        true if the field is write sensitive, false if it is not or if the persistence type is not derived
        See Also:
        isReadSensitive(), setPersistenceType(int), DERIVED
      • setWriteSensitive

        public void setWriteSensitive​(boolean flag)
                               throws ModelException
        Set whether this field element is write sensitive or not.
        Parameters:
        flag - - if true and this is a derived field, the field element is marked as write sensitive; otherwise, it is not This value is only used if getPersistenceType returns DERIVED
        Throws:
        ModelException - if impossible
        See Also:
        setReadSensitive(boolean), setPersistenceType(int), DERIVED
      • isKey

        public boolean isKey()
        Determines whether this field element is a key field or not.
        Returns:
        true if the field is a key field, false otherwise
        See Also:
        PersistenceClassElement.getKeyClass()
      • getFieldNumber

        public int getFieldNumber()
        Computes the field number of this field element.
        Returns:
        the field number of this field, -1 if it cannot be found