Class FieldExpression

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable
    Direct Known Subclasses:
    IndexExpression

    public class FieldExpression
    extends DataExpression
    Field expressions represent a field of a table. Their base is either a table or object expression. This is used for mapping queries and to allow queries on non-mapped field or tables.
    See Also:
    Serialized Form
    • Constructor Detail

      • FieldExpression

        public FieldExpression()
        FieldExpression constructor comment.
      • FieldExpression

        public FieldExpression​(DatabaseField newField)
        FieldExpression constructor comment.
      • FieldExpression

        public FieldExpression​(DatabaseField newField,
                               Expression myBase)
        FieldExpression constructor comment.
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object object)
        INTERNAL: Return if the expression is equal to the other. This is used to allow dynamic expression's SQL to be cached. This must be over written by each subclass.
        Overrides:
        equals in class DataExpression
      • computeHashCode

        public int computeHashCode()
        INTERNAL: Compute a consistent hash-code for the expression. This is used to allow dynamic expression's SQL to be cached.
        Overrides:
        computeHashCode in class Expression
      • descriptionOfNodeType

        public java.lang.String descriptionOfNodeType()
        INTERNAL: Used for debug printing.
        Overrides:
        descriptionOfNodeType in class Expression
      • getClonedFields

        public java.util.Vector getClonedFields()
        INTERNAL: If there are any fields associated with this expression, return them
      • getFields

        public java.util.Vector getFields()
        INTERNAL: Return all the fields
        Overrides:
        getFields in class Expression
      • getFieldValue

        public java.lang.Object getFieldValue​(java.lang.Object value,
                                              AbstractSession session)
        INTERNAL: Provide for conversion of the passed object's value, based on the referenced field value.
        Overrides:
        getFieldValue in class Expression
      • setField

        public void setField​(DatabaseField newField)
        INTERNAL: Set the field in the mapping.
      • twistedForBaseAndContext

        public Expression twistedForBaseAndContext​(Expression newBase,
                                                   Expression context,
                                                   Expression oldBase)
        INTERNAL: Rebuild myself against the base, with the values of parameters supplied by the context expression. This is used for transforming a standalone expression (e.g. the join criteria of a mapping) into part of some larger expression. You normally would not call this directly, instead calling twist See the comment there for more details"
        Overrides:
        twistedForBaseAndContext in class Expression
      • validateNode

        public void validateNode()
        Do any required validation for this node. Throw an exception if it's incorrect.
        Overrides:
        validateNode in class Expression
      • valueFromObject

        public java.lang.Object valueFromObject​(java.lang.Object object,
                                                AbstractSession session,
                                                AbstractRecord translationRow,
                                                int valueHolderPolicy,
                                                boolean isObjectUnregistered)
        INTERNAL: Return the value for in memory comparison. This is only valid for valueable expressions.
        Overrides:
        valueFromObject in class Expression
        isObjectUnregistered - true if object possibly not a clone, but is being conformed against the unit of work cache.
      • writeDescriptionOn

        public void writeDescriptionOn​(java.io.BufferedWriter writer)
                                throws java.io.IOException
        INTERNAL: Used to print a debug form of the expression tree.
        Overrides:
        writeDescriptionOn in class Expression
        Throws:
        java.io.IOException