类 EntityGraphs
- java.lang.Object
-
- org.hibernate.graph.EntityGraphs
-
public final class EntityGraphs extends Object
A collection ofEntityGraphutilities. These methods really belong inside other classes that we cannot modify, hence here.- 作者:
- asusnjar
-
-
构造器概要
构造器 构造器 说明 EntityGraphs()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static booleanareEqual(Map<Class,javax.persistence.Subgraph> a, Map<Class,javax.persistence.Subgraph> b)Compares two entity subgraph maps and returnstrueif they are equal, ignoring order.static booleanareEqual(javax.persistence.AttributeNode<?> a, javax.persistence.AttributeNode<?> b)Compares two entity graph attribute node and returnstrueif they are equal, ignoring subgraph attribute order.static <T> booleanareEqual(javax.persistence.EntityGraph<T> a, javax.persistence.EntityGraph<T> b)Compares two entity graphs and returnstrueif they are equal, ignoring attribute order.static booleanareEqual(javax.persistence.Subgraph a, javax.persistence.Subgraph b)Compares two entity subgraphs and returnstrueif they are equal, ignoring attribute order.static ListexecuteList(javax.persistence.Query query, javax.persistence.EntityGraph graph)Convenience method for executing the Query using the given EntityGraphstatic ListexecuteList(javax.persistence.Query query, javax.persistence.EntityGraph graph, String semanticJpaHintName)Convenience method for executing the Query, applying the given EntityGraph using the named semantic using JPA's "hint name" - seeGraphSemantic.fromJpaHintName(java.lang.String)static ListexecuteList(javax.persistence.Query query, javax.persistence.EntityGraph graph, GraphSemantic semantic)Convenience method for executing the Query, applying the given EntityGraph using the specified semanticstatic <R> List<R>executeList(javax.persistence.TypedQuery<R> query, javax.persistence.EntityGraph<R> graph)Form ofexecuteList(Query, EntityGraph, String)accepting a TypedQuerystatic <R> List<R>executeList(javax.persistence.TypedQuery<R> query, javax.persistence.EntityGraph<R> graph, String semanticJpaHintName)Form ofexecuteList(Query, EntityGraph, String)accepting a TypedQuerystatic <R> List<R>executeList(javax.persistence.TypedQuery<R> query, javax.persistence.EntityGraph<R> graph, GraphSemantic semantic)Form ofexecuteList(Query, EntityGraph, GraphSemantic)accepting a TypedQuery.static <T> javax.persistence.EntityGraph<T>merge(javax.persistence.EntityManager em, Class<T> rootType, javax.persistence.EntityGraph<T>... graphs)Merges multiple entity graphs into a single graph that specifies the fetching/loading of all attributes the input graphs specify.static <T> javax.persistence.EntityGraph<T>merge(SessionImplementor session, Class<T> rootType, GraphImplementor<T>... graphs)static <T> javax.persistence.EntityGraph<T>merge(Session session, Class<T> rootType, Graph<T>... graphs)
-
-
-
方法详细资料
-
merge
public static <T> javax.persistence.EntityGraph<T> merge(javax.persistence.EntityManager em, Class<T> rootType, javax.persistence.EntityGraph<T>... graphs)Merges multiple entity graphs into a single graph that specifies the fetching/loading of all attributes the input graphs specify.- 类型参数:
T- Root entity type of the query and graph.- 参数:
em- EntityManager to use to create the new merged graph.rootType- Root type of the entity for which the graph is being merged.graphs- Graphs to merge.- 返回:
- The merged graph.
-
merge
@SafeVarargs public static <T> javax.persistence.EntityGraph<T> merge(Session session, Class<T> rootType, Graph<T>... graphs)
-
merge
@SafeVarargs public static <T> javax.persistence.EntityGraph<T> merge(SessionImplementor session, Class<T> rootType, GraphImplementor<T>... graphs)
-
executeList
public static List executeList(javax.persistence.Query query, javax.persistence.EntityGraph graph, GraphSemantic semantic)
Convenience method for executing the Query, applying the given EntityGraph using the specified semantic- 参数:
query- The JPA Querygraph- The graph to applysemantic- The semantic to use when applying the graph
-
executeList
public static <R> List<R> executeList(javax.persistence.TypedQuery<R> query, javax.persistence.EntityGraph<R> graph, GraphSemantic semantic)
Form ofexecuteList(Query, EntityGraph, GraphSemantic)accepting a TypedQuery.- 参数:
query- The JPA Querygraph- The graph to applysemantic- The semantic to use when applying the graph
-
executeList
public static List executeList(javax.persistence.Query query, javax.persistence.EntityGraph graph, String semanticJpaHintName)
Convenience method for executing the Query, applying the given EntityGraph using the named semantic using JPA's "hint name" - seeGraphSemantic.fromJpaHintName(java.lang.String)- 参数:
query- The JPA Querygraph- The graph to applysemanticJpaHintName- SeeGraphSemantic.fromJpaHintName(java.lang.String)- 返回:
- The result list
-
executeList
public static <R> List<R> executeList(javax.persistence.TypedQuery<R> query, javax.persistence.EntityGraph<R> graph, String semanticJpaHintName)
Form ofexecuteList(Query, EntityGraph, String)accepting a TypedQuery- 参数:
query- The JPA Querygraph- The graph to applysemanticJpaHintName- SeeGraphSemantic.fromJpaHintName(java.lang.String)
-
executeList
public static List executeList(javax.persistence.Query query, javax.persistence.EntityGraph graph)
Convenience method for executing the Query using the given EntityGraph- 参数:
query- The JPA Querygraph- The graph to apply
-
executeList
public static <R> List<R> executeList(javax.persistence.TypedQuery<R> query, javax.persistence.EntityGraph<R> graph)
Form ofexecuteList(Query, EntityGraph, String)accepting a TypedQuery- 参数:
query- The JPA Querygraph- The graph to apply
-
areEqual
public static <T> boolean areEqual(javax.persistence.EntityGraph<T> a, javax.persistence.EntityGraph<T> b)Compares two entity graphs and returnstrueif they are equal, ignoring attribute order.- 类型参数:
T- Root entity type of BOTH graphs.- 参数:
a- Graph to compare.b- Graph to compare.
-
areEqual
public static boolean areEqual(javax.persistence.AttributeNode<?> a, javax.persistence.AttributeNode<?> b)Compares two entity graph attribute node and returnstrueif they are equal, ignoring subgraph attribute order.
-
areEqual
public static boolean areEqual(Map<Class,javax.persistence.Subgraph> a, Map<Class,javax.persistence.Subgraph> b)
Compares two entity subgraph maps and returnstrueif they are equal, ignoring order.
-
areEqual
public static boolean areEqual(javax.persistence.Subgraph a, javax.persistence.Subgraph b)Compares two entity subgraphs and returnstrueif they are equal, ignoring attribute order.
-
-