【发布时间】:2011-11-29 09:12:51
【问题描述】:
我在尝试在 JPA 中映射一对一关系时遇到 org.xml.sax.SAXParseException
一切正常,直到我改变
<transient name="testCase"/>
到:
<attributes>
..
<one-to-one name="testCase">
<join-column name="test_case_id"/>
</one-to-one>
..
</attributes>
给出错误:
原因:org.xml.sax.SAXParseException:cvc-complex-type.2.4.a:发现从元素“一对一”开始的无效内容。 '{"http://java.sun.com/xml/ns/persistence/orm":many-to-many, "http://java.sun.com/xml/ns/persistence/orm" 之一:嵌入,“http://java.sun.com/xml/ns/persistence/orm”:transient}' 是预期的。
我不明白异常消息的含义。为什么会出现这些?
【问题讨论】:
标签: jpa orm one-to-one