Session session = getSession();
session.beginTransaction();
Query query = session.createQuery("update Useraccount set meeting=meeting+1,useMeeting=useMeeting-1 where userId=(select userId from Signup where id="+signupID+") and chargesbasis=(select a.chargesbasis from Signup as s,Activities as a where s.id="+signupID+" and s.activitiesId=a.id)");
query.executeUpdate();
query=session.createQuery("delete from Signup where id="+signupID);
query.executeUpdate();
session.beginTransaction().commit();
if(session!=null){
session.close();
}
很简单的哈