Class QueryKey

  • All Implemented Interfaces:
    Externalizable, Serializable

    public class QueryKey
    extends Object
    implements 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 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,
                                           Object[] args)
        Return a key for the given query, or null if it is not cacheable.
      • newInstance

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

        public 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​(Collection<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​(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 Object
      • getAcessPathClassNames

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