tuscany-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "天涯′" <151835...@qq.com>
Subject How to define a sub DataObject type?
Date Wed, 30 Jan 2013 15:58:47 GMT
hi,all.I am new to SDO,I dont know how to define a property with a DataObject type.I think
it's lack in the test case "java\org\apache\tuscany\sdo\test\DynamicTypesComparisonTestCase.java"
too.
 
see the code:
 HelperContext scope = SDOUtil.createHelperContext();
  TypeHelper typeHelper = scope.getTypeHelper();
  Type intType = typeHelper.getType("commonj.sdo", "Int");
  Type stringType = typeHelper.getType("commonj.sdo", "String");
  DataObject customerType = scope.getDataFactory().create("commonj.sdo",
    "Type");
  customerType.set("uri", "http://example.com/customer");
  customerType.set("name", "Customer");
  DataObject custNumType = customerType.createDataObject("property");
  custNumType.set("name", "custNum");
  custNumType.set("type", intType);
 
Customer has Int and String type properties(simple type),my question is how to define a property
of complextype?
Mime
View raw message