Advantage of using JPAMetaModelEntityProcessor?

I just went through the link.

http://hop2croft.wordpress.com/2011/07/07/criteria-jpa-2-0-and-database-metamodel-auto-generation-with-maven/

What is the advantage of using it JPAMetaModelEntityProcessor

?

Thank!

+2


source to share


1 answer


In short, having the metamodel of your entities available at compile time can reduce runtime errors .

In particular, with the help of the metamodel, you can (the list is far from exhaustive)



  • ensure a wider range of queries are syntactically correct at compile time (compared to pure JPQL queries)
  • create dynamic, safe queries like
  • (using for example Spring JPA data> = 1.5), when using, for example, specifying the sort order, since you cannot enter any typos as is the case with strings

Cf. Dynamic, Typical Queries in JPA 2.0 and Spring Data JPA

+1


source







All Articles