Hibernate查询语句与Callback使用方法.docVIP

  • 2
  • 0
  • 约21.34万字
  • 约 20页
  • 2017-08-04 发布于河南
  • 举报
1.from子句 from Person 表明从Person持久化类中选出全部的实例。 推荐:from Person as p 2.select子句 select from Person as p select .firstName from Person as p select new list(, p.address) from Person as p select new ClassTest(, p.address) from Person as p (有前提) select as personName from Person as p select new map( as personName) from Person as p (与new map()结合更普遍) 3.统计函数查询: 1: count() 统计记录的条数 2: min() 求最小值 3: max() 求最大值 4: sum() 求和 4: avg() 求平均值 //取得Student的数量 Query query=session.createQuery(select count(*) from Student) //avg()取得Student平均年龄 Query query=session.c

文档评论(0)

1亿VIP精品文档

相关文档