public final class GraphParser extends Object
EntityGraph
(RootGraph
) and Subgraph
(SubGraph
),
using a simple syntax defined by the `graph.g` Antlr grammar.
The parse(java.lang.Class<T>, java.lang.CharSequence, javax.persistence.EntityManager)
methods all create a root EntityGraph
based on the passed entity class and parse the graph string into that root graph.
The parseInto(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. See EntityGraphs.merge(javax.persistence.EntityManager, java.lang.Class<T>, javax.persistence.EntityGraph<T>...)
.Constructor and Description |
---|
GraphParser() |
Modifier and Type | Method and Description |
---|---|
static <T> RootGraph<T> |
parse(Class<T> rootType,
CharSequence graphText,
EntityManager entityManager)
Creates a root graph based on the passed `rootType` and parses `graphText` into
the generated root graph
|
static <T> void |
parseInto(EntityGraph<T> graph,
CharSequence graphText,
EntityManager entityManager)
Parses the textual graph representation into the specified graph.
|
static <T> void |
parseInto(EntityGraph<T> graph,
CharSequence graphText,
EntityManagerFactory entityManagerFactory)
Parses the textual graph representation into the specified graph.
|
static <T> void |
parseInto(Graph<T> graph,
CharSequence graphText,
EntityManager entityManager)
Parses the textual graph representation into the specified graph.
|
static <T> void |
parseInto(Graph<T> graph,
CharSequence graphText,
EntityManagerFactory entityManagerFactory)
Parses the textual graph representation into the specified graph.
|
static <T> void |
parseInto(Subgraph<T> graph,
CharSequence graphText,
EntityManager entityManager)
Parses the textual graph representation into the specified graph.
|
static <T> void |
parseInto(Subgraph<T> graph,
CharSequence graphText,
EntityManagerFactory entityManagerFactory)
Parses the textual graph representation into the specified graph.
|
public static <T> RootGraph<T> parse(Class<T> rootType, CharSequence graphText, EntityManager entityManager)
rootType
- The root entity typegraphText
- The textual representation of the graphentityManager
- The EntityManagerInvalidGraphException
- if the textual representation is invalid.public static <T> void parseInto(Graph<T> graph, CharSequence graphText, EntityManager entityManager)
graph
- The target graph. This is the graph that will be populated by this processgraphText
- Textual representation of the graphentityManager
- The EntityManagerInvalidGraphException
- if the textual representation is invalid.public static <T> void parseInto(EntityGraph<T> graph, CharSequence graphText, EntityManager entityManager)
graph
- The target graph. This is the graph that will be populated by this processgraphText
- Textual representation of the graphentityManager
- The EntityManagerInvalidGraphException
- if the textual representation is invalid.public static <T> void parseInto(Subgraph<T> graph, CharSequence graphText, EntityManager entityManager)
graph
- The target graph. This is the graph that will be populated by this processgraphText
- Textual representation of the graphentityManager
- The EntityManagerInvalidGraphException
- if the textual representation is invalid.public static <T> void parseInto(Graph<T> graph, CharSequence graphText, EntityManagerFactory entityManagerFactory)
graph
- The target graph. This is the graph that will be populated by this processgraphText
- Textual representation of the graphentityManagerFactory
- The EntityManagerFactoryInvalidGraphException
- if the textual representation is invalid.public static <T> void parseInto(EntityGraph<T> graph, CharSequence graphText, EntityManagerFactory entityManagerFactory)
graph
- The target graph. This is the graph that will be populated by this processgraphText
- Textual representation of the graphentityManagerFactory
- The EntityManagerFactoryInvalidGraphException
- if the textual representation is invalid.public static <T> void parseInto(Subgraph<T> graph, CharSequence graphText, EntityManagerFactory entityManagerFactory)
graph
- The target graph. This is the graph that will be populated by this processgraphText
- Textual representation of the graphentityManagerFactory
- The EntityManagerFactoryInvalidGraphException
- if the textual representation is invalid.Copyright © 2001-2021 Red Hat, Inc. All Rights Reserved.