Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why two xml files?

 
Joe Harry
Ranch Hand
Posts: 10045
3
Eclipse IDE Mac PPC Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

What is the need for orm.xml and persistence.xml files?
 
Leandro Siqueira
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
  • persistence.xml defines the identities and configuration properties of persistence units;
  • orm.xml is optional and defines the mapping between classes and persistence units.



  • [ October 22, 2008: Message edited by: Leandro Siqueira ]
    [ October 22, 2008: Message edited by: Leandro Siqueira ]
     
    Joe Harry
    Ranch Hand
    Posts: 10045
    3
    Eclipse IDE Mac PPC Ubuntu
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    If I do not provide an orm.xml file, then the persistence provider will automatically map my POJO's based on the metadata annotations that I have. Am I right in this sense?
     
    Leandro Siqueira
    Greenhorn
    Posts: 6
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    exactly!

    and if you have both, xml overrides the annotations.
     
    Joe Harry
    Ranch Hand
    Posts: 10045
    3
    Eclipse IDE Mac PPC Ubuntu
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    If I were to relate this with Hibernate, a persistence.xml is something like a hibernate-cfg.xml and the orm.xml is like a mapping xml that we have in Hibernate.
     
    Chaminda Amarasinghe
    Ranch Hand
    Posts: 404
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Yes you are correct
     
    I agree. Here's the link: http://aspose.com/file-tools
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic