Class<?> clazz = MTable.getClass(table);
Constructor co = null;
try {
co = clazz.getConstructor(Properties.class, int.class, String.class);
poTmp = (PO) co.newInstance(Env.getCtx(), 0, null);
} catch (NoSuchMethodException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SecurityException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
MColumn col = MColumn.get(Env.getCtx(), po.get_TableName(), columnName);
if (col.getAD_Reference_ID() == DisplayType.Date || col.getAD_Reference_ID() == DisplayType.DateTime || col.getAD_Reference_ID() == DisplayType.Time) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date parsedDate;
try {
parsedDate = sdf.parse(value.toString());
poTmp.set_ValueOfColumn(columnName, new Timestamp(parsedDate.getTime()));
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} else if (col.getAD_Reference_ID() == DisplayType.YesNo) {
poTmp.set_ValueOfColumn(columnName, new Boolean((value.toString().equalsIgnoreCase("Y")?true:false)));
}else if (col.getAD_Reference_ID() == DisplayType.Number || col.getAD_Reference_ID() == DisplayType.Amount || col.getAD_Reference_ID() == DisplayType.Quantity) {
poTmp.set_ValueOfColumn(columnName, new BigDecimal(value.toString()));
}else if (col.getAD_Reference_ID() == DisplayType.Integer) {
poTmp.set_ValueOfColumn(columnName, new Integer(value.toString()));
}else {
poTmp.set_ValueOfColumn(columnName, value);
}
poTmp.saveEx();
?????