Class IdentificationVariableStateObject

  • All Implemented Interfaces:
    StateObject

    public class IdentificationVariableStateObject
    extends SimpleStateObject
    This state object represents a single identification variable, which is identifying TODO.
    Since:
    2.4
    Version:
    2.4
    Author:
    Pascal Filion
    See Also:
    IdentificationVariable
    • Field Detail

      • DEFINED_PROPERTY

        public static final java.lang.String DEFINED_PROPERTY
        Notify a change in the defined property.
        See Also:
        Constant Field Values
    • Constructor Detail

      • IdentificationVariableStateObject

        public IdentificationVariableStateObject​(StateObject parent)
        Creates a new IdentificationVariableStateObject.
        Parameters:
        parent - The parent of this state object, which cannot be null
        Throws:
        java.lang.NullPointerException - The given parent cannot be null
      • IdentificationVariableStateObject

        public IdentificationVariableStateObject​(StateObject parent,
                                                 java.lang.String variable)
        Creates a new IdentificationVariableStateObject.
        Parameters:
        parent - The parent of this state object, which cannot be null
        variable - The name of the identification variable
        Throws:
        java.lang.NullPointerException - The given parent cannot be null
    • Method Detail

      • getManagedType

        public IManagedType getManagedType()
        Returns the IManagedType associated with the field handled by this object. If this object does not handle a field that has a IManagedType, then null should be returned.

        For example: "SELECT e FROM Employee e", the object for e would be returning the IManagedType for Employee.

        Returns:
        Either the IManagedType, if it could be resolved; null otherwise
      • getMapping

        public IMapping getMapping()
        Returns
        Returns:
      • getType

        public IType getType()
        Returns the IType of the field handled by this object.
        Returns:
        Either the IType that was resolved by this state object or the IType for IType.UNRESOLVABLE_TYPE if it could not be resolved
      • isVirtual

        public boolean isVirtual()
        Determines whether this identification variable is virtual, meaning it's not part of the query but is required for proper navigability.
        Returns:
        true if this identification variable was virtually created to fully qualify path expression; false if it was parsed
      • setExpression

        public void setExpression​(IdentificationVariable expression)
        Keeps a reference of the parsed object object, which should only be done when this object is instantiated during the conversion of a parsed JPQL query into StateObjects.
        Parameters:
        expression - The parsed object representing an identification variable
      • setText

        public void setText​(java.lang.String text)
        Sets the text held by this state object.
        Overrides:
        setText in class SimpleStateObject
        Parameters:
        text - This model's text value
      • setVirtual

        public void setVirtual​(boolean virtual)
        Sets whether this identification variable is virtual, meaning it's not part of the query but is required for proper navigability.
        Parameters:
        virtual - true if this identification variable was virtually created to fully qualify path expression; false if it was parsed