-2
db表信息:java.lang.Long中不能被轉換爲java.math.BigDecimal的
fid [NUMBER(32,0)PK]
status [VARCHAR2(10)]
DAO類:
public Integer Update_bank_dep(Long fid, String status) {
try {
String query = "update WtrBnkdep as wb set wb.wtrbdStus=:status where wb.wtrbdUniqval=:fid";
Query queryobject = get_session().createQuery(query);
queryobject.setParameter("fid", fid);
queryobject.setParameter("status", status);
int cd = queryobject.executeUpdate();
System.out.println("cd=" + cd);
return cd;
} catch(RuntimeException ex) {
System.out.println("Error="+ex);
throw ex;
}
}
結果:
Error=java.lang.ClassCastException: java.lang.Long cannot be cast to java.math.BigDecimal
例如,'fid'列的數據庫類型是什麼等,但無論如何,這應該足以解決它。 –