[英]How to annotate a generated property as Transient in HyperJaxb3
I just want to have a property of an Entity as Transient. 我只想拥有一个实体的属性为Transient。 The older documentation[ 1 ] of HyperJaxb seems unavailable and the one on Github[ 2 ]did not help me. HyperJaxb的较旧文档[ 1 ]似乎不可用,Github [ 2 ]上的文档对我没有帮助。
I tried to use embeddable/embeddable attributes and generated-id constructs with no success. 我试图使用可嵌入/可嵌入属性和生成ID结构没有成功。
I have a model as follows and I want to have lastActivityTime as Transient in the generated class. 我有一个如下模型,我想在生成的类中将lastActivityTime作为Transient。 The current annotation of this field is one my unsuccessful attempts. 我目前未成功尝试此字段的注释。
<xsd:complexType name="ProcessInstanceGroupDAO">
<xsd:sequence>
<xsd:element name="Name" type="xsd:string"/>
<xsd:element name="archived" type="xsd:boolean"/>
<xsd:element name="lastActivityTime">
<xsd:annotation>
<xsd:appinfo>
<hj:persistence>
<hj:embeddable merge="false">
<orm:embeddable-attributes>
<orm:transient name="lastActivityTime"></orm:transient>
</orm:embeddable-attributes>
</hj:embeddable>
</hj:persistence>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
[1] confluence.highsource.org/display/HJ3/Customization+Guide [1] confluence.highsource.org/display/HJ3/Customization+Guide
[2] https://github.com/highsource/hyperjaxb3/wiki/Customization_Guide [2] https://github.com/highsource/hyperjaxb3/wiki/Customization_Guide
Simply annotate it with <hj:ignored/>
. 只需使用<hj:ignored/>
对其进行注释。 The property will be annotated with @Transient
. 该属性将使用@Transient
进行注释。
<xsd:complexType name="ProcessInstanceGroupDAO">
<xsd:sequence>
<xsd:element name="Name" type="xsd:string"/>
<xsd:element name="archived" type="xsd:boolean"/>
<xsd:element name="lastActivityTime">
<xsd:annotation>
<xsd:appinfo>
<hj:ignored/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
Disclaimer: I am the author of Hyperjaxb. 免责声明:我是Hyperjaxb的作者。 Unfortunately I no longer actively develop it. 不幸的是,我不再积极开发它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.