6

I use Hyperjaxb to generate some classes with JPA annotations from XML schemas. I'd like to specify which elements from given schema xjc should generate. I can't change xsd file. I can modify only bindings.xjb. I tried to use hj:ignored, but without success.

lexicore
  • 42,748
  • 17
  • 132
  • 221
pawb4r
  • 160
  • 1
  • 11

1 Answers1

7

Well, hj:ignored is the answer. It allows you to make Hyperjaxb ignore certain classes.

Here's an example:

    <jaxb:bindings
        node="xsd:complexType[@name='issue121Type']//xsd:element[@name='simpleCollection']">
        <hj:ignored/>
    </jaxb:bindings>

Customizations work in schema as well as via xjb files.

See this project for instance.

How does "without success" reveal itself?

lexicore
  • 42,748
  • 17
  • 132
  • 221
  • I put this line and still get @Entity etc. There's no any failures like empty element. Here — http://www.eurocris.org/Uploads/Web%20pages/CERIF2008/Release_1.2/XML-SCHEMAS/cfResPubl-RES.xsd — is xsd file. I want to omit cfResPubl. My bindings file — http://pastebin.com/chtjdfT0 . – pawb4r Jul 05 '11 at 08:13