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.