Class QueryKey

  • All Implemented Interfaces:
    java.io.Serializable

    public class QueryKey
    extends java.lang.Object
    implements java.io.Serializable
    A key that identifies a particular query with bound parameter values. This is the object Hibernate uses as its key into its query cache.
    See Also:
    Serialized Form
    • Method Detail

      • generateQueryKey

        public static QueryKey generateQueryKey​(java.lang.String queryString,
                                                QueryParameters queryParameters,
                                                java.util.Set filterKeys,
                                                SharedSessionContractImplementor session,
                                                CacheableResultTransformer customTransformer)
        Generates a QueryKey.
        Parameters:
        queryString - The sql query string.
        queryParameters - The query parameters
        filterKeys - The keys of any enabled filters.
        session - The current session.
        customTransformer - The result transformer; should be null if data is not transformed before being cached.
        Returns:
        The generate query cache key.
      • getResultTransformer

        public CacheableResultTransformer getResultTransformer()
        Provides access to the explicitly user-provided result transformer.
        Returns:
        The result transformer.
      • getNamedParameters

        public java.util.Map getNamedParameters()
        Provide (unmodifiable) access to the named parameters that are part of this query.
        Returns:
        The (unmodifiable) map of named parameters
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

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