我在eclipse控制台列表中得到的所有行上都应用了逻辑,我得到了正确的结果,一切都很好,但现在我只想再次设置值这里是我在openbravo callout
中的代码for (ShipmentType st_op : cp.getOCAShipmentTypeList()) {
String val = st_op.getName().substring(0, 3);
System.out.println(val);
Exist = val.concat(String.valueOf(CountTot));
System.out.println("Existing Value Change : " + Exist);
st_op.setName(Exist);
OBDal.getInstance().save(st_op);
}
下面是添加第三条记录后的结果控制台:
2011
2
4022
3
201
Existing Value Change : 2013
402
Existing Value Change : 4023
3
4H
3
3
4H33
我只是不能设置和保存与OBDal
OBDal.getInstance().save(st_op);
我通过声明完成了我的工作:
ShipmentType st = OBProvider.getInstance().get(ShipmentType.class);
for (ShipmentType st_op : cp.getOCAShipmentTypeList()) {
String val = st_op.getName().substring(0, 3);
System.out.println(val);
Exist = val.concat(String.valueOf(CountTot));
System.out.println("Existing Value Change : " + Exist);
st_op.setName(Exist);
}
OBDal.getInstance().save(st);