这是我的密码:
public static boolean alterReservation(int reservationId) {
try {
Session session = getSessionFactory().openSession();
Transaction transaction = session.beginTransaction();
Query query = session
.createQuery("update Reservation set realized = true where id= :reservationId");
query.setParameter("reservationId", reservationId);
transaction.commit();
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
update Reservation set realized = true where id= :reservationId
没用我也没有例外。
1条答案
按热度按时间41ik7eoe1#
这是因为您尚未执行应执行的查询: