I have a simpleType defined in one namespace.
I will use this simpleType in another namespace. So far ok. But JaxB generate the simpleType in every package with use it. I expected and need only one global simpleType definition.
Example: common.xsd (here is me simpleType) -> package.common.MyEnum account.xsd -> package.account.SomeMeComplexType + package.account.MyEnum
I would like: common.xsd -> package.common.MyEnum account.xsd -> package.account.SomeMeComplexType + reference to package.common.MyEnum
common.xsd:
<xs:simpleType name="barringScope">
<xs:restriction base="xs:long">
<xs:enumeration value="1"/>
<xs:enumeration value="2"/>
<xs:enumeration value="3"/>
</xs:restriction>
</xs:simpleType>
binding.xjb:
<jxb:bindings version="2.1" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<jxb:bindings schemaLocation="common.xsd">
<jxb:bindings node="xsd:simpleType[@name='barringScope']">
<jxb:typesafeEnumClass>
<jxb:typesafeEnumMember value="1" name="one"/>
<jxb:typesafeEnumMember value="2" name="two"/>
<jxb:typesafeEnumMember value="3" name="three"/>
</jxb:typesafeEnumClass>
</jxb:bindings>
</jxb:bindings>
</jxb:bindings>