Package org.hibernate.engine.spi
Class LoadQueryInfluencers
- java.lang.Object
-
- org.hibernate.engine.spi.LoadQueryInfluencers
-
- All Implemented Interfaces:
java.io.Serializable
public class LoadQueryInfluencers extends java.lang.Object implements java.io.Serializable
Centralize all options which can influence the SQL query needed to load an entity. Currently such influencers are defined as:- filters
- fetch profiles
- internal fetch profile (merge profile, etc)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static LoadQueryInfluencers
NONE
Static reference useful for cases where we are creating load SQL outside the context of any influencers.
-
Constructor Summary
Constructors Constructor Description LoadQueryInfluencers()
LoadQueryInfluencers(SessionFactoryImplementor sessionFactory)
LoadQueryInfluencers(SessionFactoryImplementor sessionFactory, java.lang.Boolean readOnly)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
disableFetchProfile(java.lang.String name)
void
disableFilter(java.lang.String filterName)
void
enableFetchProfile(java.lang.String name)
Filter
enableFilter(java.lang.String filterName)
EffectiveEntityGraph
getEffectiveEntityGraph()
java.util.Set<java.lang.String>
getEnabledFetchProfileNames()
Filter
getEnabledFilter(java.lang.String filterName)
java.util.Set<java.lang.String>
getEnabledFilterNames()
Returns an unmodifiable Set of enabled filter names.java.util.Map<java.lang.String,Filter>
getEnabledFilters()
EntityGraph
getFetchGraph()
Deprecated.(since 5.4)getFetchGraph()
,getLoadGraph()
,setFetchGraph(javax.persistence.EntityGraph)
andsetLoadGraph(javax.persistence.EntityGraph)
(as well as JPA itself honestly) all make it very unclear that there can be only one graph applied at any one time and that graph is *either* a load or a fetch graph.Type
getFilterParameterType(java.lang.String filterParameterName)
java.lang.Object
getFilterParameterValue(java.lang.String filterParameterName)
java.lang.String
getInternalFetchProfile()
EntityGraph
getLoadGraph()
Deprecated.(since 5.4)getFetchGraph()
,getLoadGraph()
,setFetchGraph(javax.persistence.EntityGraph)
andsetLoadGraph(javax.persistence.EntityGraph)
(as well as JPA itself honestly) all make it very unclear that there can be only one graph applied at any one time and that graph is *either* a load or a fetch graph.java.lang.Boolean
getReadOnly()
SessionFactoryImplementor
getSessionFactory()
boolean
hasEnabledFetchProfiles()
boolean
hasEnabledFilters()
boolean
isFetchProfileEnabled(java.lang.String name)
static java.lang.String[]
parseFilterParameterName(java.lang.String filterParameterName)
void
setFetchGraph(EntityGraph fetchGraph)
Deprecated.(since 5.4)getFetchGraph()
,getLoadGraph()
,setFetchGraph(javax.persistence.EntityGraph)
andsetLoadGraph(javax.persistence.EntityGraph)
(as well as JPA itself honestly) all make it very unclear that there can be only one graph applied at any one time and that graph is *either* a load or a fetch graph.void
setInternalFetchProfile(java.lang.String internalFetchProfile)
void
setLoadGraph(EntityGraph loadGraph)
Deprecated.(since 5.4)getFetchGraph()
,getLoadGraph()
,setFetchGraph(javax.persistence.EntityGraph)
andsetLoadGraph(javax.persistence.EntityGraph)
(as well as JPA itself honestly) all make it very unclear that there can be only one graph applied at any one time and that that graph is *either* a load or a fetch graph.void
setReadOnly(java.lang.Boolean readOnly)
-
-
-
Field Detail
-
NONE
public static final LoadQueryInfluencers NONE
Static reference useful for cases where we are creating load SQL outside the context of any influencers. One such example is anything created by the session factory.
-
-
Constructor Detail
-
LoadQueryInfluencers
public LoadQueryInfluencers()
-
LoadQueryInfluencers
public LoadQueryInfluencers(SessionFactoryImplementor sessionFactory)
-
LoadQueryInfluencers
public LoadQueryInfluencers(SessionFactoryImplementor sessionFactory, java.lang.Boolean readOnly)
-
-
Method Detail
-
getSessionFactory
public SessionFactoryImplementor getSessionFactory()
-
getInternalFetchProfile
public java.lang.String getInternalFetchProfile()
-
setInternalFetchProfile
public void setInternalFetchProfile(java.lang.String internalFetchProfile)
-
hasEnabledFilters
public boolean hasEnabledFilters()
-
getEnabledFilters
public java.util.Map<java.lang.String,Filter> getEnabledFilters()
-
getEnabledFilterNames
public java.util.Set<java.lang.String> getEnabledFilterNames()
Returns an unmodifiable Set of enabled filter names.- Returns:
- an unmodifiable Set of enabled filter names.
-
getEnabledFilter
public Filter getEnabledFilter(java.lang.String filterName)
-
enableFilter
public Filter enableFilter(java.lang.String filterName)
-
disableFilter
public void disableFilter(java.lang.String filterName)
-
getFilterParameterValue
public java.lang.Object getFilterParameterValue(java.lang.String filterParameterName)
-
getFilterParameterType
public Type getFilterParameterType(java.lang.String filterParameterName)
-
parseFilterParameterName
public static java.lang.String[] parseFilterParameterName(java.lang.String filterParameterName)
-
hasEnabledFetchProfiles
public boolean hasEnabledFetchProfiles()
-
getEnabledFetchProfileNames
public java.util.Set<java.lang.String> getEnabledFetchProfileNames()
-
isFetchProfileEnabled
public boolean isFetchProfileEnabled(java.lang.String name) throws UnknownProfileException
- Throws:
UnknownProfileException
-
enableFetchProfile
public void enableFetchProfile(java.lang.String name) throws UnknownProfileException
- Throws:
UnknownProfileException
-
disableFetchProfile
public void disableFetchProfile(java.lang.String name) throws UnknownProfileException
- Throws:
UnknownProfileException
-
getEffectiveEntityGraph
public EffectiveEntityGraph getEffectiveEntityGraph()
-
getFetchGraph
@Deprecated public EntityGraph getFetchGraph()
Deprecated.(since 5.4)getFetchGraph()
,getLoadGraph()
,setFetchGraph(javax.persistence.EntityGraph)
andsetLoadGraph(javax.persistence.EntityGraph)
(as well as JPA itself honestly) all make it very unclear that there can be only one graph applied at any one time and that graph is *either* a load or a fetch graph. These have all been replaced withgetEffectiveEntityGraph()
.- See Also:
EffectiveEntityGraph
-
setFetchGraph
@Deprecated public void setFetchGraph(EntityGraph fetchGraph)
Deprecated.(since 5.4)getFetchGraph()
,getLoadGraph()
,setFetchGraph(javax.persistence.EntityGraph)
andsetLoadGraph(javax.persistence.EntityGraph)
(as well as JPA itself honestly) all make it very unclear that there can be only one graph applied at any one time and that graph is *either* a load or a fetch graph. These have all been replaced withgetEffectiveEntityGraph()
.- See Also:
EffectiveEntityGraph
-
getLoadGraph
@Deprecated public EntityGraph getLoadGraph()
Deprecated.(since 5.4)getFetchGraph()
,getLoadGraph()
,setFetchGraph(javax.persistence.EntityGraph)
andsetLoadGraph(javax.persistence.EntityGraph)
(as well as JPA itself honestly) all make it very unclear that there can be only one graph applied at any one time and that graph is *either* a load or a fetch graph. These have all been replaced withgetEffectiveEntityGraph()
.- See Also:
EffectiveEntityGraph
-
setLoadGraph
@Deprecated public void setLoadGraph(EntityGraph loadGraph)
Deprecated.(since 5.4)getFetchGraph()
,getLoadGraph()
,setFetchGraph(javax.persistence.EntityGraph)
andsetLoadGraph(javax.persistence.EntityGraph)
(as well as JPA itself honestly) all make it very unclear that there can be only one graph applied at any one time and that that graph is *either* a load or a fetch graph. These have all been replaced withgetEffectiveEntityGraph()
.- See Also:
EffectiveEntityGraph
-
getReadOnly
public java.lang.Boolean getReadOnly()
-
setReadOnly
public void setReadOnly(java.lang.Boolean readOnly)
-
-