Class QueryKey

  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable

    public class QueryKey
    extends java.lang.Object
    implements java.io.Externalizable
    This class stores information about a particular invocation of a query. It contains a reference to the external properties of the query that was executed, as well as any parameters used to execute that query, with one exception: first-class objects used as parameter values are converted to OIDs.
    Author:
    Patrick Linskey
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      QueryKey()
      Public constructor for externalization only.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean changeInvalidatesQuery​(java.util.Collection<java.lang.Class<?>> changed)
      Returns true if modifications to any of the classes in changed results in a possible invalidation of this query; otherwise returns false.
      boolean equals​(java.lang.Object ob)
      Determine equality based on identifying information.
      java.util.Set<java.lang.String> getAcessPathClassNames()
      Returns the set of the accessPathClassnames that exists in the query
      java.lang.String getCandidateTypeName()
      Returns the candidate class name for this query.
      int getTimeout()
      Return the amount of time this key is good for.
      int hashCode()
      Define a hashing algorithm corresponding to the equals(java.lang.Object) method defined above.
      static QueryKey newInstance​(Query q)
      Return a key for the given query, or null if it is not cacheable.
      static QueryKey newInstance​(Query q, java.lang.Object[] args)
      Return a key for the given query, or null if it is not cacheable.
      static QueryKey newInstance​(Query q, java.util.Map<java.lang.Object,​java.lang.Object> args)
      Return a key for the given query, or null if it is not cacheable.
      void readExternal​(java.io.ObjectInput in)  
      java.lang.String toString()  
      void writeExternal​(java.io.ObjectOutput out)  
      • Methods inherited from class java.lang.Object

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

      • QueryKey

        public QueryKey()
        Public constructor for externalization only.
    • Method Detail

      • newInstance

        public static QueryKey newInstance​(Query q)
        Return a key for the given query, or null if it is not cacheable.
      • newInstance

        public static QueryKey newInstance​(Query q,
                                           java.lang.Object[] args)
        Return a key for the given query, or null if it is not cacheable.
      • newInstance

        public static QueryKey newInstance​(Query q,
                                           java.util.Map<java.lang.Object,​java.lang.Object> args)
        Return a key for the given query, or null if it is not cacheable.
      • getCandidateTypeName

        public java.lang.String getCandidateTypeName()
        Returns the candidate class name for this query.
      • getTimeout

        public int getTimeout()
        Return the amount of time this key is good for.
      • changeInvalidatesQuery

        public boolean changeInvalidatesQuery​(java.util.Collection<java.lang.Class<?>> changed)
        Returns true if modifications to any of the classes in changed results in a possible invalidation of this query; otherwise returns false. Invalidation is possible if one or more of the classes in this query key's access path has been changed.
      • equals

        public boolean equals​(java.lang.Object ob)
        Determine equality based on identifying information. Keys created for queries that specify a candidate collection are always not equal.
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Define a hashing algorithm corresponding to the equals(java.lang.Object) method defined above.
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • writeExternal

        public void writeExternal​(java.io.ObjectOutput out)
                           throws java.io.IOException
        Specified by:
        writeExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
      • readExternal

        public void readExternal​(java.io.ObjectInput in)
                          throws java.io.IOException,
                                 java.lang.ClassNotFoundException
        Specified by:
        readExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • getAcessPathClassNames

        public java.util.Set<java.lang.String> getAcessPathClassNames()
        Returns the set of the accessPathClassnames that exists in the query
        Returns:
        -- Returns a set of accesspath classnames.