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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a new key-value pair for a hint.Creates and returns a newQueryHintsinstance that will contain only those hints applicable for count queries.voidforEach(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 newQueryHintsinstance includingEntityGraph.
-
Constructor Details
-
MutableQueryHints
public MutableQueryHints()
-
-
Method Details
-
withFetchGraphs
Description copied from interface:QueryHintsCreates and returns a newQueryHintsinstance includingEntityGraph.- Specified by:
withFetchGraphsin interfaceQueryHints- Parameters:
em- must not be null.- Returns:
- new instance of
QueryHints.
-
forCounts
Description copied from interface:QueryHintsCreates and returns a newQueryHintsinstance that will contain only those hints applicable for count queries.- Specified by:
forCountsin interfaceQueryHints- Returns:
- new instance of
QueryHints.
-
forEach
Description copied from interface:QueryHintsPerforms 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:
forEachin 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-
-