Class QueryField

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected QueryField​(FromElement qc, java.lang.String fieldName, java.lang.String secondFieldName, java.lang.Class<?> type)
      Constructs a QueryField object - intended for cloning operations.
        QueryField​(QueryClassBag qcb)
      Constructs the id QueryField for the given QueryClassBag.
        QueryField​(QueryClass qc, java.lang.String fieldName)
      Constructs a QueryField representing the specified field of a QueryClass
        QueryField​(Query q, QueryClass qc, java.lang.String fieldName)
      Constructs a QueryField representing the specified field of the specified QueryClass, as seen outside the specified subquery.
        QueryField​(Query q, QueryEvaluable v)
      Constructs a QueryField representing the specified entry from the SELECT list of the specified subquery.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)
      Returns true if this is equal to the given object.
      int getApproximateType()
      Returns an integer representing the approximate type of this QueryEvaluable, in the case where an accurate type cannot be ascertained.
      java.lang.String getFieldName()
      Returns the name of the field.
      FromElement getFromElement()
      Gets the FromElement of which the field is a member
      java.lang.String getSecondFieldName()
      Returns the name of the second field.
      java.lang.Class<?> getType()
      Get Java type represented by this item.
      int hashCode()
      Returns a hash code for this object.
      java.lang.String toString()
      Produces a String, for debugging purposes.
      void youAreType​(java.lang.Class<?> cls)
      Allows a caller to suggest to this object that it holds a value of a certain type.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • QueryField

        public QueryField​(QueryClass qc,
                          java.lang.String fieldName)
        Constructs a QueryField representing the specified field of a QueryClass
        Parameters:
        qc - the QueryClass
        fieldName - the name of the relevant field
        Throws:
        java.lang.NullPointerException - if the field name is null
        java.lang.IllegalArgumentException - if the field is a reference, a collection or does not exist
      • QueryField

        public QueryField​(Query q,
                          QueryClass qc,
                          java.lang.String fieldName)
        Constructs a QueryField representing the specified field of the specified QueryClass, as seen outside the specified subquery.
        Parameters:
        q - the Query object that is the subquery
        qc - the QueryClass that the field is a member of
        fieldName - the name of the relevant field
        Throws:
        java.lang.NullPointerException - if the field name is null
        java.lang.IllegalArgumentException - if the field is a collection or does not exist
      • QueryField

        public QueryField​(Query q,
                          QueryEvaluable v)
        Constructs a QueryField representing the specified entry from the SELECT list of the specified subquery.
        Parameters:
        q - the Query object that is the subquery
        v - the entry of the SELECT list
        Throws:
        java.lang.NullPointerException - if the field name is null
      • QueryField

        public QueryField​(QueryClassBag qcb)
        Constructs the id QueryField for the given QueryClassBag.
        Parameters:
        qcb - the QueryClassBag
      • QueryField

        protected QueryField​(FromElement qc,
                             java.lang.String fieldName,
                             java.lang.String secondFieldName,
                             java.lang.Class<?> type)
        Constructs a QueryField object - intended for cloning operations.
        Parameters:
        qc - the FromElement
        fieldName - the first field name
        secondFieldName - the second field name
        type - the Class of the value
    • Method Detail

      • getFromElement

        public FromElement getFromElement()
        Gets the FromElement of which the field is a member
        Returns:
        the FromElement
      • getType

        public java.lang.Class<?> getType()
        Get Java type represented by this item.
        Specified by:
        getType in interface QueryOrderable
        Specified by:
        getType in interface QuerySelectable
        Returns:
        class describing the type
      • getFieldName

        public java.lang.String getFieldName()
        Returns the name of the field.
        Returns:
        field name
      • getSecondFieldName

        public java.lang.String getSecondFieldName()
        Returns the name of the second field.
        Returns:
        second field name
      • toString

        public java.lang.String toString()
        Produces a String, for debugging purposes.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a String representation
      • youAreType

        public void youAreType​(java.lang.Class<?> cls)
        Allows a caller to suggest to this object that it holds a value of a certain type. This method should only be called on objects which report their type to be UnknownTypeValue. Otherwise, this method will throw and exception.
        Specified by:
        youAreType in interface QueryEvaluable
        Parameters:
        cls - the Class of the type to be imposed on this object
      • getApproximateType

        public int getApproximateType()
        Returns an integer representing the approximate type of this QueryEvaluable, in the case where an accurate type cannot be ascertained.
        Specified by:
        getApproximateType in interface QueryEvaluable
        Returns:
        an int, as described in UnknownTypeValue
      • equals

        public boolean equals​(java.lang.Object o)
        Returns true if this is equal to the given object.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - the object
        Returns:
        a boolean
      • hashCode

        public int hashCode()
        Returns a hash code for this object.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        an int