Package org.hibernate.engine.spi
Class EffectiveEntityGraph
java.lang.Object
org.hibernate.engine.spi.EffectiveEntityGraph
- All Implemented Interfaces:
Serializable,AppliedGraph
Think of this as the composite modeling of a graph and the semantic.
Its graph and semantic can be obtained by getGraph() and
getSemantic()
They can be managed by calls to applyGraph(org.hibernate.graph.spi.RootGraphImplementor<?>, org.hibernate.graph.GraphSemantic), applyConfiguredGraph(java.util.Map<java.lang.String, ?>)
and clear()
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyConfiguredGraph(@Nullable Map<String, ?> properties) Apply a graph and semantic based on configuration properties or hints based onGraphSemantic.getJpaHintName()forGraphSemantic.LOADorGraphSemantic.FETCH.voidapplyGraph(RootGraphImplementor<?> graph, @Nullable GraphSemantic semantic) Apply the graph and semantic.voidclear()@Nullable RootGraphImplementor<?> getGraph()The applied graph@Nullable GraphSemanticThe semantic (fetch/load) under which the graph should be applied
-
Constructor Details
-
EffectiveEntityGraph
- Implementation Specification:
- 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
- Implementation Specification:
- See
EffectiveEntityGraph(boolean)
-
-
Method Details
-
getSemantic
Description copied from interface:AppliedGraphThe semantic (fetch/load) under which the graph should be applied- Specified by:
getSemanticin interfaceAppliedGraph
-
getGraph
Description copied from interface:AppliedGraphThe applied graph- Specified by:
getGraphin interfaceAppliedGraph
-
applyGraph
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
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()
-