Record Class QueryOption.ResultSetCache
java.lang.Object
java.lang.Record
org.hibernate.query.QueryOption.ResultSetCache
- Record Components:
region- The second-level cache region to use, ornullfor the default query cache region
- All Implemented Interfaces:
TypedQuery.Option
- Enclosing interface:
QueryOption
public static record QueryOption.ResultSetCache(@Nullable String region)
extends Record
implements TypedQuery.Option
Specifies that the query result set should be cached in the given region.
This is different to second-level caching of any returned entities
and collections, which is controlled by the CacheMode.
The query being "eligible" for caching does not necessarily mean its results will be cached; second-level query caching must also be explicitly enabled by setting the configuration property "hibernate.cache.use_query_cache".
- Since:
- 8.0
-
Constructor Summary
ConstructorsConstructorDescriptionResultSetCache(String region) Creates an instance of aResultSetCacherecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.region()Returns the value of theregionrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ResultSetCache
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
region
-