类 GraphParser
- java.lang.Object
-
- org.hibernate.graph.GraphParser
-
public final class GraphParser extends Object
Parser for string representations of JPAEntityGraph(RootGraph) andSubgraph(SubGraph), using a simple syntax defined by the `graph.g` Antlr grammar. Theparse(java.lang.Class<T>, java.lang.CharSequence, javax.persistence.EntityManager)methods all create a rootEntityGraphbased on the passed entity class and parse the graph string into that root graph. TheparseInto(org.hibernate.graph.Graph<T>, java.lang.CharSequence, javax.persistence.EntityManager)methods parse the graph string into a passed graph, which may be a sub-graph Multiple graphs made for the same entity type can be merged. SeeEntityGraphs.merge(javax.persistence.EntityManager, java.lang.Class<T>, javax.persistence.EntityGraph<T>...).- 作者:
- asusnjar
-
-
构造器概要
构造器 构造器 说明 GraphParser()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static <T> RootGraph<T>parse(Class<T> rootType, CharSequence graphText, javax.persistence.EntityManager entityManager)Creates a root graph based on the passed `rootType` and parses `graphText` into the generated root graphstatic <T> voidparseInto(javax.persistence.EntityGraph<T> graph, CharSequence graphText, javax.persistence.EntityManager entityManager)Parses the textual graph representation into the specified graph.static <T> voidparseInto(javax.persistence.EntityGraph<T> graph, CharSequence graphText, javax.persistence.EntityManagerFactory entityManagerFactory)Parses the textual graph representation into the specified graph.static <T> voidparseInto(javax.persistence.Subgraph<T> graph, CharSequence graphText, javax.persistence.EntityManager entityManager)Parses the textual graph representation into the specified graph.static <T> voidparseInto(javax.persistence.Subgraph<T> graph, CharSequence graphText, javax.persistence.EntityManagerFactory entityManagerFactory)Parses the textual graph representation into the specified graph.static <T> voidparseInto(Graph<T> graph, CharSequence graphText, javax.persistence.EntityManager entityManager)Parses the textual graph representation into the specified graph.static <T> voidparseInto(Graph<T> graph, CharSequence graphText, javax.persistence.EntityManagerFactory entityManagerFactory)Parses the textual graph representation into the specified graph.
-
-
-
方法详细资料
-
parse
public static <T> RootGraph<T> parse(Class<T> rootType, CharSequence graphText, javax.persistence.EntityManager entityManager)
Creates a root graph based on the passed `rootType` and parses `graphText` into the generated root graph- 参数:
rootType- The root entity typegraphText- The textual representation of the graphentityManager- The EntityManager- 抛出:
InvalidGraphException- if the textual representation is invalid.
-
parseInto
public static <T> void parseInto(Graph<T> graph, CharSequence graphText, javax.persistence.EntityManager entityManager)
Parses the textual graph representation into the specified graph.- 参数:
graph- The target graph. This is the graph that will be populated by this processgraphText- Textual representation of the graphentityManager- The EntityManager- 抛出:
InvalidGraphException- if the textual representation is invalid.
-
parseInto
public static <T> void parseInto(javax.persistence.EntityGraph<T> graph, CharSequence graphText, javax.persistence.EntityManager entityManager)Parses the textual graph representation into the specified graph.- 参数:
graph- The target graph. This is the graph that will be populated by this processgraphText- Textual representation of the graphentityManager- The EntityManager- 抛出:
InvalidGraphException- if the textual representation is invalid.
-
parseInto
public static <T> void parseInto(javax.persistence.Subgraph<T> graph, CharSequence graphText, javax.persistence.EntityManager entityManager)Parses the textual graph representation into the specified graph.- 参数:
graph- The target graph. This is the graph that will be populated by this processgraphText- Textual representation of the graphentityManager- The EntityManager- 抛出:
InvalidGraphException- if the textual representation is invalid.
-
parseInto
public static <T> void parseInto(Graph<T> graph, CharSequence graphText, javax.persistence.EntityManagerFactory entityManagerFactory)
Parses the textual graph representation into the specified graph.- 参数:
graph- The target graph. This is the graph that will be populated by this processgraphText- Textual representation of the graphentityManagerFactory- The EntityManagerFactory- 抛出:
InvalidGraphException- if the textual representation is invalid.
-
parseInto
public static <T> void parseInto(javax.persistence.EntityGraph<T> graph, CharSequence graphText, javax.persistence.EntityManagerFactory entityManagerFactory)Parses the textual graph representation into the specified graph.- 参数:
graph- The target graph. This is the graph that will be populated by this processgraphText- Textual representation of the graphentityManagerFactory- The EntityManagerFactory- 抛出:
InvalidGraphException- if the textual representation is invalid.
-
parseInto
public static <T> void parseInto(javax.persistence.Subgraph<T> graph, CharSequence graphText, javax.persistence.EntityManagerFactory entityManagerFactory)Parses the textual graph representation into the specified graph.- 参数:
graph- The target graph. This is the graph that will be populated by this processgraphText- Textual representation of the graphentityManagerFactory- The EntityManagerFactory- 抛出:
InvalidGraphException- if the textual representation is invalid.
-
-