Class MutableQueryHints
java.lang.Object
org.springframework.data.jpa.repository.support.MutableQueryHints
- All Implemented Interfaces:
QueryHints
Mutable implementation of
QueryHints
, without the Option to switch between
forCounts()
/withFetchGraphs(EntityManager)
hints.- Since:
- 2.4
- Author:
- Jens Schauder, Mark Paluch
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.data.jpa.repository.support.QueryHints
QueryHints.NoHints
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a new key-value pair for a hint.Creates and returns a newQueryHints
instance that will contain only those hints applicable for count queries.void
forEach
(BiConsumer<String, Object> action) Performs the given action for each element of this query hints object until all hints have been processed or the action throws an exception.withFetchGraphs
(jakarta.persistence.EntityManager em) Creates and returns a newQueryHints
instance includingEntityGraph
.
-
Constructor Details
-
MutableQueryHints
public MutableQueryHints()
-
-
Method Details
-
withFetchGraphs
Description copied from interface:QueryHints
Creates and returns a newQueryHints
instance includingEntityGraph
.- Specified by:
withFetchGraphs
in interfaceQueryHints
- Parameters:
em
- must not be null.- Returns:
- new instance of
QueryHints
.
-
forCounts
Description copied from interface:QueryHints
Creates and returns a newQueryHints
instance that will contain only those hints applicable for count queries.- Specified by:
forCounts
in interfaceQueryHints
- Returns:
- new instance of
QueryHints
.
-
forEach
Description copied from interface:QueryHints
Performs the given action for each element of this query hints object until all hints have been processed or the action throws an exception. Actions are performed in the order of iteration, if that order is specified. Exceptions thrown by the action are relayed to the caller.Passes each query hint to the consumer. Query hint keys might appear more than once.
- Specified by:
forEach
in interfaceQueryHints
- Parameters:
action
- to process query hints consisting of a key and a value.
-
add
Add a new key-value pair for a hint.- Parameters:
name
-value
-
-