1

I have an issue in that I cannot figure out how to customise the column length of the content of a ComplexType using an entry in a bindings.xjc file.

The Complex Type is defined as:

  <xsd:element name="Comment">
    <xsd:complexType>
      <xsd:simpleContent>
        <xsd:extension base="xsd:string">
          <xsd:attribute name="MyAttr" type="MyAttrSchemaType"/>
        </xsd:extension>
      </xsd:simpleContent>
    </xsd:complexType>
  </xsd:element>

The bindings.xjc file entry is:

  <jaxb:bindings node="xsd:element[@name='Comment']/xsd:complexType">
    <hj:basic name="value">
      <orm:column length="1024"/>
    </hj:basic>
  </jaxb:bindings>

The resulting Java code is:

  public class Comment implements Serializable, Equals, HashCode {

    @XmlValue
    protected String value;
    ...

    @Basic
    @Column(name = "VALUE_", length = 255)
    public String getValue() {
      return value;
    }

    ...
  }

The issue is that when I run the Maven build this customisation is ignored but the others are applied successfully.

The following warnings appear in the build output and I believe the first is related:

[WARNING] Unacknowledged customization [{http://hyperjaxb3.jvnet.org/ejb/schemas/customizations}basic] in the class [...Comment].

[WARNING] Episode file [.../target/generated-sources/xjc/META-INF/sun-jaxb.episode] is not writable, could not add if-exists attributes.

I have spent a lot of time searching for answers and reading the available docs but have so far drawn a blank so any help greatly appreciated.

0 Answers0