java 我在哪里可以找到 jpa orm.xml 使用示例
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4596380/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where can i find jpa orm.xml usage samples
提问by user562811
I am trying to see some usage samples of JPA orm.xml. If some one direct me to a link,
我正在尝试查看 JPA orm.xml 的一些使用示例。如果有人将我指向一个链接,
回答by James
The schema is here,
架构在这里,
http://java.sun.com/xml/ns/persistence/orm_2_0.xsd
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
http://en.wikibooks.org/wiki/Java_Persistence
Lots of examples here, http://wiki.eclipse.org/EclipseLink/Examples/JPA
这里有很多例子, http://wiki.eclipse.org/EclipseLink/Examples/JPA
In particular, http://wiki.eclipse.org/EclipseLink/Examples/JPA/EmployeeXML
特别是, http://wiki.eclipse.org/EclipseLink/Examples/JPA/EmployeeXML
回答by Randy
This may not be a complete answer but, http://www.jpox.org/docs/1_2/tutorials/jpa_tutorial.htmluses 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.
这可能不是一个完整的答案,但是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 appears to be falling out of favor for the annotation version, which explains the difficulty of finding any good examples of ORM.xml file.
ORM.xml 似乎不再受注释版本的青睐,这解释了很难找到 ORM.xml 文件的任何好的示例。