| Author |
Why two xml files?
|
Joe Harry
Ranch Hand
Joined: Sep 26, 2006
Posts: 8795
|
|
Guys, What is the need for orm.xml and persistence.xml files?
|
SCJP 1.4, SCWCD 1.4 - Hints for you, SCBCD Hints - Demnachst, SCDJWS - Auch Demnachst
Did a rm -R / to find out that I lost my entire Linux installation!
|
 |
Leandro Siqueira
Greenhorn
Joined: Jun 05, 2005
Posts: 6
|
|
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
Joined: Sep 26, 2006
Posts: 8795
|
|
|
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
Joined: Jun 05, 2005
Posts: 6
|
|
exactly! and if you have both, xml overrides the annotations.
|
 |
Joe Harry
Ranch Hand
Joined: Sep 26, 2006
Posts: 8795
|
|
|
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
Joined: May 17, 2006
Posts: 402
|
|
|
Yes you are correct
|
 |
 |
|
|
subject: Why two xml files?
|
|
|