给ADF EO的属性设置值

来源:互联网 发布:白金网络作家 编辑:程序博客网 时间:2024/05/16 07:36

继承EO的对象类,在该类中使用下面的代码片段。

entityDef是EO的定义类对象,需要先确定属性的类型。

[java] view plaincopyprint?
  1.                         AttributeDef atrDef =  
  2.                             entityDef.getAttributeDefImpl(attributeName);  
  3.   
  4.   
  5.                         if ("class java.math.BigDecimal".equals(atrDef.getJavaType().toString())) {  
  6.                             BigDecimal bdValue = new BigDecimal(strColValue);  
  7.                             this.setAttribute(attributeName, bdValue);  
  8.                         } else if (...) {  
  9.   
  10.                             ... ...  
  11.                         }