List of the other data types

The following section provides information about how to define other data types, for example double byte, which can be used with the attribute generation in EMD.

The BusinessObjectAttribute represents a Business Object Attribute definition, in terms of XSD maps to an element definition within a complexType. It holds information like name, type, cardinality, metadata, maxlength. So the setType() method actually set the type of the xsd element, so the type used here can be element type supported by XSD definition. Basically, you can refer to the SDO specification (9.4 Mapping of XSD Build-in data types) or the set methods in com.ibm.despi.OutputAccessor (we use DESPI to access the SDO, so actually the types supported in DESPI are the current types we can map from the XSD) for the details.

Regarding the array type, the SDO support property has many values (Collection or List, refer the SDO specification for details), and in terms of XSD maps to an element which has maxOccurs attribute set to unbound. In the BusinessObjectAttribute, you can use setCadinality("N") to specify it. And with DESPI, you can use the OutputAccessor.set["TYPE"](value, index) instead of the set["Type"](value) method to write value for the property with many values. However, you cannot directly setType("byte[]").

For example,

For byte[], because XSD has hexBinary and base64Binary can map to Java™ type byte[], and also in DESPI, we have setBytes(byte[] value), so you can declare a BusinessObjectAttribute as:
attribs.put("Name", createBODAttributeInfo("hexBinary", "1", false)); 
But for String[] or int[], there is no XSD type can map to (there is xsd:ENTITIES can map to Java List<String>, but the DESPI does not have setStrings(List<String>)). So you have to declare a BusinessObjectAttribute as:
attribs.put("Name", createBODAttributeInfo("String", "N", false));
It declares an element in your BO schema as:
<xsd:element name="Name" type="xsd:String" maxOccurs="unbound"/>



Feedback

(C) Copyright IBM Corporation 2005, 2012. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)