6320ch_DEV_post_migration.fm

Draft Document for Review July 28, 2004 7:33 pm

Tip: Mapping OrderItemAccessBean to Item considerations:

If an accessor is not available in the interface to Item, it is possible to access the underlying OrderItemAccessBean using the following method:

public OrderItemAccessBean getOrderItem()

This should be avoided, if at all possible.

Table 8-2shows only the accessors that directly map between

OrderItemAccessBean and Item. If, for example, the WebSphere

Commerce Suite V5.1 code contains the line:

String strQuantity = oiab.getQuantity()

Then this could be migrated into the following line:

String strQuantity = item.getOrderItem().getQuantity()

But most likely, the code should be rewritten to use the getQuantity method of the Item class, using BigDecimal objects instead strings to hold the order quantity.

If any of the setter methods on the Item class are used, the commit method should be used to commit the changes to the underlying OrderItemAccessBean:

item.setShippingTaxTotal(bdTaxTotal);

item.setShippingTotal(bdTotal);

item.commit();

If it cannot be avoided to modify values directly in the OrderItemAccessBean, the envelope Item bean should be refreshed in addition calling commitCopyHelper:

OrderItemAccessBean oiab = item.getOrderItem(); oiab.setShippingTaxTotal(“22”); oiab.setShippingTotal(“220”); oiab.commitCopyHelper();

item.refresh();

Table 8-2 Mapping from use of the OrderItemAccessBean to the Item envelope class

Accessing OrderItemAccessBean

Accessing Item

 

 

getStoreIdInEJBType()

getStoreEntityId()

setStoreId(lStoreId)

setStoreEntityId(lStoreId)

 

 

getStatus()

getStatus()

setStatus()

setStatus()

 

 

getCatalogEntryIdInEJBType()

getCatalogEntryId()

setCatalogEntryId(lCatEntId)

setCatalogEntryId(lCatEntId)

 

 

142Keeping Commerce Applications Updated WebSphere Commerce 5.1 to 5.6 Migration Guide

Page 160
Image 160
IBM SG24-6320-00 manual Then this could be migrated into the following line, Accessing OrderItemAccessBean Accessing Item