Hibernate-检索

Hibernate的 HQL和QBC检索。 HQL 主要依据QUERY接口, 执行HQL语句, 可以动态的改变HQL参数的名字(参数名, 位置), 链式编程。 QBC就是QUERY BY CRETIRA, 创建某一类的CRETIRA, 用EXPRESSIONG的静态方法产生查询条件, 返回CRETIRION实例, 然后用CRETIRA对象ADD。(CRETIRION), 调用CRETIRA.LIST()返回查询结果。 HQL and QBC CAN do batch query, we can set first record position from results that we get from databases, and set max records we can get every time. HQL and QBC also support uniqueResult() method. 不能写类似于SELECT * FROM CUSTMOER WHERE NAME = NULL, it will return null ever null = null or name = null from SQL query criteria. HQL can setInt(), setString for our query string. QBE(QUERY BY EXAMPLE), it should give a example of the object that we want to query. and query the results.

posted on 2006-08-29 08:26 Sheldon Sun 阅读(153) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航:
 
<2024年5月>
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

导航

统计

常用链接

留言簿(3)

随笔档案

文章档案

搜索

最新评论

阅读排行榜

评论排行榜