• 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
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

orm.xml and persistence.xml  RSS feed

 
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.
 
I knew I would regret that burrito. But this tiny ad has never caused regrets:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!