Skip to content

Commit 52aaaa5

Browse files
amirensitschauder
authored andcommitted
DATAJPA-1639 - Fix position of _ in MetaModel classes in the documentation.
According to hibernate documentation, The name of the metamodel class is derived from the name of the managed class by appending "_" to the name of the managed class.
1 parent 5bff1e4 commit 52aaaa5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/asciidoc/jpa.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ public class CustomerSpecs {
764764
CriteriaBuilder builder) {
765765
766766
LocalDate date = new LocalDate().minusYears(2);
767-
return builder.lessThan(root.get(_Customer.createdAt), date);
767+
return builder.lessThan(root.get(Customer_.createdAt), date);
768768
}
769769
};
770770
}
@@ -782,7 +782,7 @@ public class CustomerSpecs {
782782
----
783783
====
784784

785-
Admittedly, the amount of boilerplate leaves room for improvement (that may eventually be reduced by Java 8 closures), but the client side becomes much nicer, as you will see later in this section. The `_Customer` type is a metamodel type generated using the JPA Metamodel generator (see the link:$$https://docs.jboss.org/hibernate/jpamodelgen/1.0/reference/en-US/html_single/#whatisit$$[Hibernate implementation's documentation for an example]). So the expression, `_Customer.createdAt`, assumes the `Customer` has a `createdAt` attribute of type `Date`. Besides that, we have expressed some criteria on a business requirement abstraction level and created executable `Specifications`. So a client might use a `Specification` as follows:
785+
Admittedly, the amount of boilerplate leaves room for improvement (that may eventually be reduced by Java 8 closures), but the client side becomes much nicer, as you will see later in this section. The `Customer_` type is a metamodel type generated using the JPA Metamodel generator (see the link:$$https://docs.jboss.org/hibernate/jpamodelgen/1.0/reference/en-US/html_single/#whatisit$$[Hibernate implementation's documentation for an example]). So the expression, `_Customer.createdAt`, assumes the `Customer` has a `createdAt` attribute of type `Date`. Besides that, we have expressed some criteria on a business requirement abstraction level and created executable `Specifications`. So a client might use a `Specification` as follows:
786786

787787
.Using a simple Specification
788788
====

0 commit comments

Comments
 (0)