简体   繁体   中英

Hibernate index using hyperjaxb3

I am trying to add an index to a simple attribute using hyperjaxb, using the following fragment in my .xjb file:

<jxb:bindings node="./xsd:attribute[@name='serviceCode']">
    <annox:annotate target="getter">
        <annox:annotate annox:class="org.hibernate.annotations.Index" name="product_index_serviceCode" columnNames="SERVICE_CODE"/>
    </annox:annotate>
    <hj:basic>
        <orm:column length="120"/>
    </hj:basic>
</jxb:bindings>

I am getting an "Error parsing annotation.' error on the line where I have the annotation in the .xjb file. If I remove the annotation, then it works fine, but obviously, I do not get the index. I also tried moving the annotation inside the hj:basic element. In that case I do not get an error, but there is again no index being generated.

如@lexicore所示,您需要将Hibernate批注JAR作为插件放置在JAXB Annotate插件旁边。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM