pojia

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
1.elements:此函数返回所有对象集合
例如:  select elements(blog.Comments) from Blog blog  返回全部blog对象的全部Comment
2.size:此函数计算集合的长度
例如: from Cat cat where size(cat.kittens) > 0
3.maxindex函数得到集合的最大索引数
 例如:from Cat cat where maxindex(cat.kittens) >1000  
    当cat对象中kittens集合的最大索引大于1000时,,,返回cat
3.maxelement函数得到集合的值
 例如:from Cat cat where maxelement(cat.kittens) >1000   
    当cat对象中kittens集合中的最大值大于1000  时,,,返回cat

3.index函数
 例如:from Cat cat where index(cat.kittens) >12 
    当cat对象中kittens集合中的索引大于12时,,,返回cat




http://www.hibernate.org/hib_docs/reference/en/html/queryhql.html
posted on 2007-08-07 14:41  破甲  阅读(1381)  评论(0编辑  收藏  举报