【发布时间】:2015-03-25 10:04:08
【问题描述】:
我正在尝试添加一个额外的列,使用绑定文件到从 xsd(一个大的)获得的模型。添加的字段需要持久化,但不需要序列化。
我尝试使用hj:generated-property,但它没有任何作用。
为了提供迄今为止我尝试过的示例,我在标签 0.6.0 ejb/tests/po-customized 上使用 PO Sample from git sources 进行了测试,并将其添加到绑定中...
bindings.xjb
...
<jaxb:bindings node="xs:complexType[@name='PurchaseOrderType']">
<hj:entity>
<orm:table name="po"/>
<!-- adding creation timeStamp -->
<hj:generated-property name="creationTimestamp" propertyName="creationTimestamp" propertyQName="creationTimestamp"
propertyKind="xs:dateTime" />
</hj:entity>
</jaxb:bindings>
...
运行mvn clean test 时,PurchaseOrderType 没有新字段。测试运行没有错误。
是否可以添加这样的字段?
【问题讨论】:
标签: java hibernate xsd jaxb hyperjaxb