• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

orm.xml and persistence.xml

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please explain the difference between these two xmls?. What is the purpose of orm.xml?.
 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
persistence.xml used to define the JDBC driver and connectivtey with database additional that you define the unit name.

orm.xml you can skipped it and use the annotation insted of that.
orm.xml used to mapping object to database.

best regards,
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi juz wan to ask can we use other name like abc.xml instead of orm.xml?

Thanl you very much
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
persistence.xml is for storing database details used behind hibernate. Mostly you have one persistence.xml file in your application which is common for all entities.

orm.xml is mostly used per entity. For employee entity, employee-orm.xml. For Manager entity, manager-orm.xml etc.

Note that i have used the term "mostly". Its bacuse you can have one orm file for all entirties but that is not a good practice.
 
Your mother was a hamster and your father was a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!