The notion of whether or not a property is set is critical to processing null values
or values that have not been set in the adapter. If a property has been explicitly set
to null, the adapter must be able to detect this and set the associated property to
null in the EIS.
If the property has not been set, it might still have a null value, but the adapter
will ignore the value and not set it in the EIS system.
A list of bean properties for which the setter is called is returned when
getSetAttributes() is called. This will enable the DESPI implementation to
determine if a particular attribute has been set.
Property order:
The notion of property order is critical, because the adapter may need to iterate
over the properties in the same order that they appear in the EIS system.
Since JavaBean APIs cannot detect the order present in the class file, there must be
a string array called
″
propertyOrder
″
in the bean, containing the names of all
properties in the desired order.
public static final String[] propertyOrder = {"property1","property2"};
SDO to JavaBeanRecord ASI Mappings
: Annotations from the SDO/XML schema are
read and stored in a Map structure in the bean. Here is a description of how the
RecordGenerator would populate annotation maps. For each element in the
metadata annotation, the generator would create an entry in the Map with the
name of the element as the key.
v
If the element is a simple type with single cardinality then the value of this
element is added to the Map.
v
If the element is a simple type with n-cardinality, then a List is generated
containing one or more values of this element.
The List is then added to the annotation Map.
v
If the element is a complex type with single cardinality then a Map is created
containing the mappings for elements of this child complex type.
The Map is then added to the annotation Map.
v
If the element is a complex type of multiple cardinality then a List is created.
The List would contain one or more Map entries where each Map contains the
mapping for the elements of the child complex type.
Here is an example of how the object level metadata annotation would look like in
an SDO schema:
<annotation>
<appinfo source="http://www.ibm.com/xmlns/prod/websphere/j2ca/sap/metadata">
<sapasi:sapBAPIBusinessObjectTypeMetadata xmlns:sapasi="http://www.ibm.com/xmlns/prod/websphere/j2ca/sap/metadata">
<sapasi:Type>BAPI</sapasi:Type>
<sapasi:Operation>
<sapasi:MethodName>BAPI_CUSTOMER_CREATEFROMDATA1</sapasi:MethodName>
<sapasi:Name>Create</sapasi:Name>
</sapasi:Operation>
<sapasi:Operation>
<sapasi:MethodName>BAPI_CUSTOMER_CHANGEFROMDATA1</sapasi:MethodName>
<sapasi:Name>Updatewithdelete</sapasi:Name>
</sapasi:Operation>
</sapasi:sapBAPIBusinessObjectTypeMetadata>
</appinfo>
</annotation>
WebSphere Adapter development overview
117
Summary of Contents for WebSphere Adapters
Page 2: ......
Page 6: ...iv WebSphere Adapters WebSphere Adapter Toolkit User Guide...
Page 220: ...214 WebSphere Adapters WebSphere Adapter Toolkit User Guide...
Page 224: ...218 WebSphere Adapters WebSphere Adapter Toolkit User Guide...
Page 225: ......
Page 226: ...Printed in USA...