You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Kelvin Goodson (JIRA)" <tu...@ws.apache.org> on 2007/07/11 17:37:04 UTC
[jira] Resolved: (TUSCANY-1408) Cannot programmatically define a
SDO property matching to XSD element
[ https://issues.apache.org/jira/browse/TUSCANY-1408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kelvin Goodson resolved TUSCANY-1408.
-------------------------------------
Resolution: Fixed
> Cannot programmatically define a SDO property matching to XSD element
> ---------------------------------------------------------------------
>
> Key: TUSCANY-1408
> URL: https://issues.apache.org/jira/browse/TUSCANY-1408
> Project: Tuscany
> Issue Type: Bug
> Components: Java SDO Implementation
> Affects Versions: Java-SDO-1.0
> Environment: WinXP
> Reporter: Fuhwei Lwo
> Fix For: Java-SDO-1.0
>
> Attachments: 1408.patch, 1408.patch
>
>
> 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);
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org