Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
架构在这里,
http://java.sun.com/xml/ns/ persistence/orm_2_0.xsd
这里有很多每种映射类型的示例,
http://en .wikibooks.org/wiki/Java_Persistence
这里有很多例子,
http://wiki.eclipse.org/EclipseLink/Examples/JPA
特别是,
http://wiki.eclipse.org/EclipseLink/Examples/JPA/EmployeeXML
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
这可能不是一个完整的答案,但是 http://www.jpox.org/ docs/1_2/tutorials/jpa_tutorial.html 使用 JPA 1.0。然而,当我为 JPA 2.0 创建 ORM.xml 时,它很有用。我知道 O'Reilly 的“Enterprise JavaBeans 3.0”也有很好的例子。否则,您必须查看架构(将发布链接,但显然我没有足够的代表来发布多个链接)并将其与注释示例相匹配......至少这是我必须做的。
ORM.xml 似乎不再受注释版本的青睐,这解释了很难找到任何好的 ORM.xml 文件示例。
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.