问题
I am trying to see some usage samples of JPA orm.xml. If some one direct me to a link,
回答1:
The schema is here,
http://java.sun.com/xml/ns/persistence/orm_2_0.xsd
There are lots of samples of each mapping type here,
http://en.wikibooks.org/wiki/Java_Persistence
Lots of examples here, http://wiki.eclipse.org/EclipseLink/Examples/JPA
In particular, http://wiki.eclipse.org/EclipseLink/Examples/JPA/EmployeeXML
回答2:
This may not be a complete answer but, http://www.jpox.org/docs/1_2/tutorials/jpa_tutorial.html uses JPA 1.0. However, it was of use when I created my ORM.xml for JPA 2.0. I know "Enterprise JavaBeans 3.0" from O'Reilly has good examples too. Otherwise you have to look at the schema (would post the link but apparently I don't have enough rep to post multiple links) and match it up with annotations examples...at least that is what I had to do.
ORM.xml appears to be falling out of favor for the annotation version, which explains the difficulty of finding any good examples of ORM.xml file.
来源:https://stackoverflow.com/questions/4596380/where-can-i-find-jpa-orm-xml-usage-samples