2

In my XSD, I have an xs:choice element that is transformed as a List of a new type by JAXB.

Using Hyperjaxb3, I'm trying to customize the name of the table associated to that new type, but I haven't been able to.

XSD:

<xs:element name="explicitDimension">
    <xs:complexType>
        <xs:choice minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="fws:member"/>
        </xs:choice>
        <xs:attribute name="dimension" use="required" type="xs:NMTOKEN"/>
        <xs:attribute name="hierarchy" use="optional" type="xs:anyURI"/>
        <xs:attribute name="axis" use="optional" type="xs:string"/>
    </xs:complexType>
</xs:element>

<xs:element name="member" type="xs:NMTOKEN"/>

ExplicitDimension.java

public class ExplicitDimension implements Serializable, Equals, HashCode {
    ...
    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
    protected List<String> member;
    protected transient List<ExplicitDimensionMemberItem> memberItems;
    ...
}

ExplicitDimensionMemberItem.java

@Entity(name = "ExplicitDimensionMemberItem")
@Table(name = "EXPLICIT_DIMENSION_MEMBER_IT_0")
@Inheritance(strategy = InheritanceType.JOINED)
public class ExplicitDimensionMemberItem implements Serializable, Item<String> {
    ....
}

How do I need to use bindings.xjb in order to change that EXPLICIT_DIMENSION_MEMBER_IT_0 to the value I need? I've been looking through the documentation and samples, but couldn't found any relevant example.

Hope this is my last question related to this. Thanks in advance.

Ivan Clavijos
  • 163
  • 1
  • 7
  • I encountered the same problem, do you happen to find a solution and remember it ? – Nicolas Oct 27 '20 at 15:49
  • 1
    Hi @Nicolas As far as I remember, I found no way to resolve this, but that was quite long ago and I no longer work there, so I have no way to find out how we fixed that (but I would say we finally didn't find a solution and had to use some sort of work around). Apologies – Ivan Clavijos Oct 27 '20 at 18:42
  • Thanks @Ivan, I modified the xsd like that only for the generation of classes, and it looks like it works with the XML I have. – Nicolas Oct 29 '20 at 10:36

0 Answers0