[eVista]EntityHandle, ModelEntity, ModelEntityBean, MTIObject
Posted on 2006-12-13 11:27 hcfalan 阅读(446) 评论(0) 编辑 收藏 举报item_handle to EntityHandle
import com.sdrc.metaphase.enterprise.es.base.Accessor;
Accessor accessor = (Accessor)esManager.getProcessor("base.Accessor", esSession);
EntityHandle entity_handle = accessor.reconstructEntityHandle(item_handle);
EntityHandle to MTIObject
import COM.metaphasetech.mot.MTIObject;
MTIObject obj = ProcessorImpl. getMTIObject(entity_handle);
item_handle to MTIObject
MTIObject obj = ProcessorImpl.getMTIObject(item_handle);
item_handle to ModelEntity
import com.sdrc.metaphase.enterprise.es.base.ModelEntity;
ModelEntity
Accessible
Accessor accessor = (Accessor)esManager.getProcessor(“base.Accessor”, esSession);
EntityHandle entity_handle = accessor.reconstructEntityHandle(item_handle);
Accessible model_entity = accessor.get(entity_handle);
MTIObject to ModelEntity
import COM.metaphasetech.mot.MTIObject;
import com.sdrc._metaphase.enterprise.es_evista.base.ModelEntity;
MTIObject obj = …;
ModelEntity me = new ModelEntity(obj);
How to get Attribute from MTIObject
MTIObject obj;
Object partNumber = obj.getInternalObject().getAttribute("PartNumber");
How to get Attribute from EntityHandle
Frist, convert EntityHandle to ModelEntity:
ModelEntity model_entity = accessor.get(entity_handle);
Second, convert ModelEntity to ModelEntityBean:
ModelEntityBean bean = ModelEntityBeanFactory.createModelEntityBean(action_context, arguments, model_entity);
At last, get Attribute from bean:
Object partNumber = bean.getItemAttributeValue("PartNumber");
ObjectSet from cs to bs
MTIObjectVector is returned while call cs;
ArrayList list = new ArrayList();
For each MTIObject item in MTIObjectVector
{
convert item to ModelEntity(way is involved before);
add the ModelEntity to list;
}
Use system action chain to convert list to ModelEntityContainerBean;
// chain id is “eds_mwau_act_chain_prepare_collection_for_display”