Skip to content

Commit ca1eb99

Browse files
committed
HHH-19216 - NamedEntityGraph annotation supporting Hibernate parseable format
HHH-19237 - Expand graph language to optionally specify entity HHH-19217 - Expose GraphParser#parse on SessionFactory
1 parent b67190a commit ca1eb99

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

hibernate-core/src/main/java/org/hibernate/annotations/NamedEntityGraph.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@
5050
String name() default "";
5151

5252
/**
53-
* The textual representation of the graph - e.g., {@code "title, isbn, author(name, books)"}.
53+
* The textual representation of the graph.
54+
* <p/>
55+
* When applied to a package, the syntax requires the entity name - e.g., {@code "Book: title, isbn, author(name, books)"}.
56+
* <p/>
57+
* When applied to an entity, the entity name should be omitted - e.g., {@code "title, isbn, author(name, books)"}.
58+
* <p/>
5459
* See {@linkplain org.hibernate.graph.GraphParser} for details about the syntax.
5560
*/
5661
String graph();

hibernate-core/src/main/java/org/hibernate/graph/GraphParser.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,7 @@
2323
* attributeNode:: attributePath subGraph?
2424
* subGraph:: LPAREN (subTypeEntityName COLON)? attributeList RPAREN
2525
* </pre>
26-
*
27-
* JPA {@link jakarta.persistence.EntityGraph}
28-
* ({@link RootGraph}) and {@link jakarta.persistence.Subgraph} ({@link SubGraph}),
29-
* using a simple syntax defined by the {@code graph.g} ANTLR grammar. For example:
30-
* <pre>employees(username, password, accessLevel, department(employees(username)))</pre>
31-
* <p>
26+
* <p/>
3227
* The {@link #parse} methods all create a root {@link jakarta.persistence.EntityGraph}
3328
* based on the passed entity class and parse the graph string into that root graph.
3429
* <p>

0 commit comments

Comments
 (0)