日期:2014-05-20 浏览次数:20632 次
public void subMoney(int subAccountID,int exchangeMoney){ Session session = this.getSession(); Transaction tx = session.beginTransaction(); String hql = "update CCBAccountPO set property = property - " + exchangeMoney +" where id = " + subAccountID; Query query = session.createQuery(hql); query.executeUpdate(); tx.commit(); }
public void addMoney(int addAccountID,int exchangeMoney){ Session session = this.getSession(); Transaction tx = session.beginTransaction(); String hql = "update ICBCAccountPO set property = property +" + exchangeMoney + " where id = " + addAccountID; Query query = session.createQuery(hql); query.executeUpdate(); tx.commit(); }