0

I just want to have a property of an Entity as Transient. The older documentation[1] of HyperJaxb seems unavailable and the one on Github[2]did not help me.

I tried to use embeddable/embeddable attributes and generated-id constructs with no success.

I have a model as follows and I want to have lastActivityTime as Transient in the generated class. 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

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

suat
  • 4,239
  • 3
  • 28
  • 51

1 Answers1

1

Simply annotate it with <hj:ignored/>. The property will be annotated with @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. Unfortunately I no longer actively develop it.

lexicore
  • 42,748
  • 17
  • 132
  • 221
  • Great, thanks a lot @lexicore ! Regarding the older documentation. I don't know it has more coverage comparing the one in Github. If so, would it be possible to make it available online even if for a short period so that I can download it? – suat Apr 02 '18 at 15:15
  • Please see: https://github.com/highsource/hyperjaxb3/issues/37 I think wiki contains all the old documentation, converted from old Confluence using some converter. – lexicore Apr 02 '18 at 15:18