• Post Reply Bookmark Topic Watch Topic
  • New Topic

Location for storing NamedQuery  RSS feed

Mike Cheung
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, has anyone attempted to place namedqueries in XML files external to the entity classes' code? Just looking at http://jdevelopment.nl/put-named-queries-jpa/ and it appears we can place them within individual XML files, and reference them from the persistence.xml file.



Digging this a bit further it appears that this <mapping-file></mapping-file> is originally used for defining ORM mappings.

Has anyone tried defining the NamedQueries via this method and can comment on pros and cons?
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!