Package org.hibernate.engine.spi
Class EffectiveEntityGraph
- java.lang.Object
-
- org.hibernate.engine.spi.EffectiveEntityGraph
-
- All Implemented Interfaces:
Serializable,AppliedGraph
public class EffectiveEntityGraph extends Object implements AppliedGraph, Serializable
Think of this as the composite modeling of a graph and the semantic. Its graph and semantic can be obtained bygetGraph()andgetSemantic()They can be managed by calls toapplyGraph(org.hibernate.graph.spi.RootGraphImplementor<?>, org.hibernate.graph.GraphSemantic),applyConfiguredGraph(java.util.Map<java.lang.String, ?>)andclear()- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description EffectiveEntityGraph()EffectiveEntityGraph(boolean allowOverwrite)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyConfiguredGraph(Map<String,?> properties)Apply a graph and semantic based on configuration properties or hints based onGraphSemantic.getJpaHintName()forGraphSemantic.LOADorGraphSemantic.FETCH.voidapplyGraph(RootGraphImplementor<?> graph, GraphSemantic semantic)Apply the graph and semantic.voidclear()RootGraphImplementor<?>getGraph()The applied graphGraphSemanticgetSemantic()The semantic (fetch/load) under which the graph should be applied
-
-
-
Constructor Detail
-
EffectiveEntityGraph
public EffectiveEntityGraph()
- ImplSpec:
- I explicitly made this constructor package protected
because we may need to pass in the SessionFactory or JpaCompliance
etc to be able to know what to do in
applyConfiguredGraph(Map)when the incoming properties contain both aGraphSemantic.FETCHand aGraphSemantic.LOAD. In other words, we may need to add some constructor argument here so we want to control what can call it
-
EffectiveEntityGraph
public EffectiveEntityGraph(boolean allowOverwrite)
- ImplSpec:
- See
EffectiveEntityGraph(boolean)
-
-
Method Detail
-
getSemantic
public GraphSemantic getSemantic()
Description copied from interface:AppliedGraphThe semantic (fetch/load) under which the graph should be applied- Specified by:
getSemanticin interfaceAppliedGraph
-
getGraph
public RootGraphImplementor<?> getGraph()
Description copied from interface:AppliedGraphThe applied graph- Specified by:
getGraphin interfaceAppliedGraph
-
applyGraph
public void applyGraph(RootGraphImplementor<?> graph, GraphSemantic semantic)
Apply the graph and semantic. The semantic is required. The graph may be null, but that should generally be considered mis-use.- Throws:
IllegalArgumentException- Thrown if the semantic is nullIllegalStateException- If previous state is still available (hasn't been cleared).
-
applyConfiguredGraph
public void applyConfiguredGraph(Map<String,?> properties)
Apply a graph and semantic based on configuration properties or hints based onGraphSemantic.getJpaHintName()forGraphSemantic.LOADorGraphSemantic.FETCH. The semantic is required. The graph may be null, but that should generally be considered mis-use.- Throws:
IllegalArgumentException- If both kinds of graphs were present in the properties/hintsIllegalStateException- If previous state is still available (hasn't been cleared).
-
clear
public void clear()
-
-