Uploaded image for project: 'Tuscany'
  1. Tuscany
  2. TUSCANY-2098

Bidirectional properties are not working in XSD2JavaGenerator

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Reopened
    • Blocker
    • Resolution: Unresolved
    • Java-SDO-1.0
    • Java-SDO-Next
    • Java SDO Tools
    • None

    Description

      Bidirectional relations seems to be broken in XSD2JavaGenerator. It generates code which can't be compiled. Here is the sample schema.

      <?xml version="1.0" encoding="UTF-8"?>
      <xsd:schema targetNamespace="http://www.generated.example.sdo.org/Library"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sdoXML="commonj.sdo/xml"
      xmlns:sdoJava="commonj.sdo/java" xmlns:sdo="commonj.sdo"
      xmlns:lib="http://www.generated.example.sdo.org/Library"
      sdoJava:package="org.sdo.example.generated.library">

      <xsd:complexType name="Book">
      <xsd:sequence>
      <xsd:element name="title" type="xsd:string"/>
      <xsd:element name="pages" type="xsd:int"/>
      <xsd:element name="category" type="lib:BookCategory"/>
      <xsd:element name="author" type="lib:Writer" sdoXML:oppositeProperty="books" sdoXML:propertyType="lib:Writer"/>
      </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name="Writer">
      <xsd:sequence>
      <xsd:element name="name" type="xsd:string"/>
      <xsd:element name="books" type="lib:Book" minOccurs="0" maxOccurs="unbounded" sdoXML:oppositeProperty="author" sdoXML:propertyType="lib:Book"/>
      </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name="Library">
      <xsd:sequence>
      <xsd:element name="name" type="xsd:string"/>
      <xsd:element name="writers" type="lib:Writer" minOccurs="0" maxOccurs="unbounded" />
      <xsd:element name="books" type="lib:Book" minOccurs="0" maxOccurs="unbounded" />
      </xsd:sequence>
      </xsd:complexType>
      <xsd:simpleType name="BookCategory">
      <xsd:restriction base="xsd:NCName">
      <xsd:enumeration value="Mystery"/>
      <xsd:enumeration value="ScienceFiction"/>
      <xsd:enumeration value="Biography"/>
      </xsd:restriction>
      </xsd:simpleType>
      </xsd:schema>

      Attachments

        1. library.xsd
          2 kB
          Surinder Pal Singh Bindra
        2. libraryDataGraphGenerated.xml
          1 kB
          Surinder Pal Singh Bindra
        3. SdoClient.java
          6 kB
          Surinder Pal Singh Bindra
        4. XmlDMS.java
          0.9 kB
          Surinder Pal Singh Bindra
        5. XmlDMSImpl.java
          2 kB
          Surinder Pal Singh Bindra

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sbindra Surinder Pal Singh Bindra
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: