1、命名参数
Query q = sess.createQuery("from DomesticCat cat where cat.name = :name");
q.setString("name", "Fritz");

2、位置参数
Query q = sess.createQuery("from DomesticCat cat where cat.name = ?");
q.setString(0, "Izi");

3、命名参数列表
Query q = sess.createQuery("from DomesticCat cat where cat.name in (:namesList)");
q.setParameterList("namesList", names);

参考文章:http://www.cnblogs.com/leetle/archive/2006/12/08/586402.html

相关文章:

  • 2022-01-15
  • 2021-10-14
  • 2021-08-29
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-21
  • 2021-06-12
  • 2021-10-23
  • 2021-05-16
  • 2021-06-29
相关资源
相似解决方案