0

我只想拥有一个实体的属性作为瞬态。HyperJaxb的旧文档[ 1 ] 似乎不可用,Github[ 2 ] 上的文档对我没有帮助。

我尝试使用可嵌入/可嵌入属性和生成的 id 构造,但没有成功。

我有一个模型如下,我想在生成的类中将 lastActivityTime 作为 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: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

[2] https://github.com/highsource/hyperjaxb3/wiki/Customization_Guide

4

1 回答 1

1

只需用<hj:ignored/>. 该属性将用 注释@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>

免责声明:我是 Hyperjaxb 的作者。不幸的是,我不再积极开发它。

于 2018-04-02T15:06:53.223 回答