Class MutableQueryHints

java.lang.Object
org.springframework.data.jpa.repository.support.MutableQueryHints
All Implemented Interfaces:
QueryHints

public class MutableQueryHints extends Object implements 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:
  • Constructor Details

    • MutableQueryHints

      public MutableQueryHints()
  • Method Details

    • withFetchGraphs

      public QueryHints withFetchGraphs(jakarta.persistence.EntityManager em)
      Description copied from interface: QueryHints
      Creates and returns a new QueryHints instance including EntityGraph.
      Specified by:
      withFetchGraphs in interface QueryHints
      Parameters:
      em - must not be null.
      Returns:
      new instance of QueryHints.
    • forCounts

      public QueryHints forCounts()
      Description copied from interface: QueryHints
      Creates and returns a new QueryHints instance that will contain only those hints applicable for count queries.
      Specified by:
      forCounts in interface QueryHints
      Returns:
      new instance of QueryHints.
    • forEach

      public void forEach(BiConsumer<String,Object> action)
      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 interface QueryHints
      Parameters:
      action - to process query hints consisting of a key and a value.
    • add

      public void add(String name, Object value)
      Add a new key-value pair for a hint.
      Parameters:
      name -
      value -