java - Hyperjaxb3: How do I get it to use a superclass' id? -


i'm trying generate set of java classes *.xsd files have common mapped-super-class (called dataobject). far i've managed generate classes descendants of dataobject using following in bindings.xjb file:

  <jaxb:globalbindings localscoping="toplevel">         <xjc:superclass name="com.companyname.model.dataobject"/>         <jaxb:serializable uid="1" />     </jaxb:globalbindings> 

my problem hyperjaxb3 generates own primary key called hjid, dataobject contains primary key , need/want use that.

so, how stop hyperjaxb3 generating hjid classes? i've tried various suggestions i've found online, didn't work me.

you or mark 1 of existing properties identifier property using hj:id customization element. see following:

<xs:complextype name="mytype">     <xs:sequence>         <!-- ... -->         <xs:element name="id" type="xs:int" minoccurs="0">             <xs:annotation>                 <xs:appinfo>                     <hj:id>                         <orm:column name="my_id"/>                         <orm:generated-value strategy="sequence" generator="my-sequence"/>                         <orm:sequence-generator name="my-sequence" sequence-name="my_seq"/>                     </hj:id>                  </xs:appinfo>             </xs:annotation>         </xs:element>         <!-- ... -->     </xs:sequence> </xs:complextype> 

or

<xs:element name="id" type="xs:int" minoccurs="0">     <xs:annotation>         <xs:appinfo>             <hj:id/>         </xs:appinfo>     </xs:annotation> </xs:element> 

Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -