Query query = s.createQuery("insert into Paymentinfo(appointid, appointfees, status, pid) values=(?,?,?,?)");
query.setParameter(0, totalBooks);
query.setParameter(1, ml.getFees());
query.setParameter(2, "Pending");
query.setParameter(3, ml.getPid());
query.executeUpdate();
答案 0 :(得分:1)
HQL不支持带值插入。所以基本上使用POJO类或点击以下链接
https://docs.jboss.org/hibernate/orm/4.0/devguide/en-US/html/ch04.html