Class PersistenceFieldElement

All Implemented Interfaces:
PersistenceElementProperties, Comparable
Direct Known Subclasses:
RelationshipElement

public class PersistenceFieldElement extends PersistenceMemberElement
Version:
%I%
Author:
raccah
  • Field Details

    • PERSISTENT

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

      public static final int DERIVED
      Constant representing a derived field modifier.
      See Also:
    • 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:
  • Constructor Details

    • 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 Details

    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • setKey

      public void setKey(boolean flag) throws ModelException
      Set whether this field element is a key field or not.
      Parameters:
      flag - - if true, the field element is marked as a key field; otherwise, it is not
      Throws:
      ModelException - if impossible
      See Also:
    • getConcurrencyGroups

      public ConcurrencyGroupElement[] getConcurrencyGroups()
      Returns the array of concurrency groups to which this field belongs.
      Returns:
      the concurrency groups in which this field participates
      See Also:
    • 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