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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
applyConfiguredGraph
(@Nullable Map<String, ?> properties) Apply a graph and semantic based on configuration properties or hints based onGraphSemantic.getJpaHintName()
forGraphSemantic.LOAD
orGraphSemantic.FETCH
.void
applyGraph
(RootGraphImplementor<?> graph, @Nullable GraphSemantic semantic) Apply the graph and semantic.void
clear()
@Nullable RootGraphImplementor<?>
getGraph()
The applied graph@Nullable GraphSemantic
The 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.FETCH
and 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:AppliedGraph
The semantic (fetch/load) under which the graph should be applied- Specified by:
getSemantic
in interfaceAppliedGraph
-
getGraph
Description copied from interface:AppliedGraph
The applied graph- Specified by:
getGraph
in 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.LOAD
orGraphSemantic.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()
-