为什么我用hibernate的executeUpdate方法无法对数据库里的数据进行修改呢?!!
public int updateIsApprovedByStudentIdWish(Integer isApproved,
Integer matchStudentId, Integer wish) {
if (isApproved == null || matchStudentId == null || wish == null
|| isApproved.equals(""
|| matchStudentId.equals(""
|| wish.equals(""
)
return 0;
try {
Query query = getSession().createQuery(
UPDATE_IS_APPROVED_BY_STUDENT_ID_WISH);
query.setInteger(0, isApproved);
query.setInteger(1, matchStudentId);
query.setInteger(2, wish);
return query.executeUpdate();
} catch (RuntimeException re) {
log.error("updateLoginidByNickname failed", re);
throw re;
}
}
这是代码,求高手指教!
|