• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

JPA EclipseLink orm.xml and persistence.xml

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All,

I am new to JPA and using Toplink (Oracle's distribution of the open-source EclipseLink) with JPA annotations . I am a bit confused with the purpose of the orm.xml and persistence.xml.

All the JPA based java classes (representative of each underlying database table) should be cataloged in the orm.xml file or persistence.xml file.

I have seen examples on the internet which have entries sometimes in the orm file and sometimes in the persistence file.

Let me know.

Thanks..
 
Ranch Hand
Posts: 553
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The orm.xml file is an option to use to map your entities instead of using annotations, if you are using annotations then you do not need it.

The persistence.xml should technically list all of the persistent classes using the <class> tag, but if all of your classes are in the same jar file as your persistence.xml, then these will be discovered by default in JEE,
and in JSE if you set <exclude-unlisted-classes>false</exclude-unlisted-classes>.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic