Skip to content

Files

Latest commit

ef090cd · Dec 17, 2019

History

History

HibernateSpringBootDtoSpringProjectionOrmXmlNamedQuery

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Dec 17, 2019
Dec 17, 2019
Dec 17, 2019

How To Use JPA Named Queries Via orm.xml File And Spring Projection (DTO)

Description: This application is an example of combining JPA named queries listed in orm.xml file and Spring projections (DTO). For queries names we use the {EntityName}.{RepositoryMethodName} naming convention. This convention allows us to create in the repository interface methods with the same name as of named query.

Key points:

  • define the named queries in orm.xml file in a folder named META-INF the application classpath
  • define the proper Spring projection

If you need a deep dive into the performance recipes exposed in this repository then I am sure that you will love my book "Spring Boot Persistence Best Practices"If you need a hand of tips and illustrations of 100+ Java persistence performance issues then "Java Persistence Performance Illustrated Guide" is for you.