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

Cannot programmatically define a SDO property matching to XSD element

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Java-SDO-1.0
    • Java-SDO-1.0
    • None
    • WinXP

    Description

      The following code will define XSD attributes for "name" and "address" properties. I cannot find a way to define them as XSD elements.

      HelperContext hc = HelperProvider.getDefaultContext();
      DataFactory dataFactory = hc.getDataFactory();

      TypeHelper types = hc.getTypeHelper();
      Type stringType = types.getType("commonj.sdo", "String");

      DataObject customerType = dataFactory.create("commonj.sdo","Type");
      customerType.set("uri", "http://sample.data/customer");
      customerType.set("name", "Customer");

      //create customer name property
      DataObject custNameProperty = customerType.createDataObject("property");
      custNameProperty.set("name", "name");
      custNameProperty.set("type", stringType);

      //create address property
      DataObject addressProperty = customerType.createDataObject("property");
      addressProperty.set("name", "address");
      addressProperty.set("type", stringType);

      //now define the Customer type so that customers can be made
      Type typeDefined = types.define(customerType);

      Attachments

        1. 1408.patch
          14 kB
          Fuhwei Lwo
        2. 1408.patch
          7 kB
          Fuhwei Lwo

        Activity

          People

            Unassigned Unassigned
            fuhwei Fuhwei Lwo
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: