You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hibernate's {generator}[Metamodel Generator] is an annotation processor that produces what JPA calls a _static metamodel_.
117
+
That is, it produces a typed model of the persistent classes in our program, giving us a type-safe way to refer to their attributes in Java code.
118
+
In particular, it lets us specify <<entity-graph,entity graphs>> and <<criteria-queries,criteria queries>> in a completely type-safe way.
119
+
120
+
We've already seen how to set up the annotation processor in the <<hello-hibernate,gradle build>> we saw earlier.
121
+
122
+
Now, you don't have to use the Metamodel Generator with Hibernate—the APIs we just mentioned also accept plain strings—but we find that it works well with gradle and integrates well with our IDE, and the advantage in typesafety is compelling.
123
+
124
+
You can find more information in the {generator-guide}[User Guide].
Copy file name to clipboardExpand all lines: documentation/src/main/asciidoc/introduction/Interacting.adoc
+2-7Lines changed: 2 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -382,8 +382,7 @@ This results in a SQL query with _four_ ``left outer join``s.
382
382
383
383
[NOTE]
384
384
====
385
-
In the code examples above, we're making use of the JPA static metamodel.
386
-
The classes `Book_` and `Author_` are generated by the annotation processor we have in our <<hello-hibernate,gradle build>>, one of the <<optional-dependencies,optional dependencies>> of Hibernate.
385
+
In the code examples above, The classes `Book_` and `Author_` are generated by the <<metamodel-generator,JPA Metamodel Generator>> we saw earlier.
387
386
They let us refer to attributes of our model in a completely type-safe way.
388
387
We'll use them again, below, when we talk about <<criteria-queries>>.
Here, the classes `Book_` and `Author_` are classes generated by Hibernate's {generator}[JPA Metamodel Generator], which is documented in the {generator-guide}[User Guide].
656
-
They let us refer to attributes of our entities in a typesafe way.
651
+
Here, as before, the classes `Book_` and `Author_` are generated by Hibernate's <<metamodel-generator,JPA Metamodel Generator>>.
0 commit comments