• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Location for storing NamedQuery

 
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.

persistence.xml


Website.xml


Digging this a bit further it appears that this <mapping-file></mapping-file> is originally used for defining ORM mappings.
http://java.dzone.com/articles/persisting-entity-classes

Has anyone tried defining the NamedQueries via this method and can comment on pros and cons?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic