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.