hql插入带有参数的查询

时间:2018-12-18 05:58:39

标签: hql

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();

1 个答案:

答案 0 :(得分:1)

HQL不支持带值插入。所以基本上使用POJO类或点击以下链接

https://docs.jboss.org/hibernate/orm/4.0/devguide/en-US/html/ch04.html