生活随笔
收集整理的這篇文章主要介紹了
Hibernate Reference Documentation
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
http://docs.jboss.org/hibernate/core/3.6/reference/zh-CN/html/index.html
?
前言 1. 教程 1.1. 第一部分 - 第一個 Hibernate 應(yīng)用程序 1.1.1. 設(shè)置 1.1.2. 第一個 class 1.1.3. 映射文件 1.1.4. Hibernate 配置 1.1.5. 用 Maven 構(gòu)建 1.1.6. 啟動和輔助類 1.1.7. 加載并存儲對象 1.2. 第二部分 - 關(guān)聯(lián)映射 1.2.1. 映射 Person 類 1.2.2. 單向 Set-based 的關(guān)聯(lián) 1.2.3. 使關(guān)聯(lián)工作 1.2.4. 值類型的集合 1.2.5. 雙向關(guān)聯(lián) 1.2.6. 使雙向連起來 1.3. 第三部分 - EventManager web 應(yīng)用程序 1.3.1. 編寫基本的 servlet 1.3.2. 處理與渲染 1.3.3. 部署與測試 1.4. 總結(jié)
2. 體系結(jié)構(gòu)(Architecture) 2.1. 概況(Overview) 2.1.1. Minimal architecture 2.1.2. Comprehensive architecture 2.1.3. Basic APIs 2.2. JMX 整合 2.3. 上下文相關(guān)的會話(Contextual Session)
3. 配置 3.1. 可編程的配置方式 3.2. 獲得 SessionFactory 3.3. JDBC 連接 3.4. 可選的配置屬性 3.4.1. SQL 方言 3.4.2. 外連接抓取(Outer Join Fetching) 3.4.3. 二進(jìn)制流(Binary Streams) 3.4.4. 二級緩存與查詢緩存 3.4.5. 查詢語言中的替換 3.4.6. Hibernate 的統(tǒng)計(statistics)機(jī)制 3.5. 日志 3.6. 實現(xiàn) NamingStrategy 3.7. Implementing a PersisterClassProvider 3.8. XML 配置文件 3.9. Java EE Application Server integration 3.9.1. 事務(wù)策略配置 3.9.2. JNDI 綁定的 SessionFactory 3.9.3. 在 JTA 環(huán)境下使用 Current Session context(當(dāng)前 session 上下文)管理 3.9.4. JMX 部署
4. 持久化類(Persistent Classes) 4.1. 一個簡單的 POJO 例子 4.1.1. 實現(xiàn)一個默認(rèn)的(即無參數(shù)的)構(gòu)造方法(constructor) 4.1.2. Provide an identifier property 4.1.3. Prefer non-final classes (semi-optional) 4.1.4. 為持久化字段聲明訪問器(accessors)和是否可變的標(biāo)志(mutators)(可選) 4.2. 實現(xiàn)繼承(Inheritance) 4.3. 實現(xiàn) equals() 和 hashCode() 方法: 4.4. 動態(tài)模型(Dynamic models) 4.5. 元組片斷映射(Tuplizers) 4.6. EntityNameResolvers
5. 對象/關(guān)系數(shù)據(jù)庫映射基礎(chǔ)(Basic O/R Mapping) 5.1. 映射定義(Mapping declaration) 5.1.1. Entity 5.1.2. Identifiers 5.1.3. Optimistic locking properties (optional) 5.1.4. Property 5.1.5. Embedded objects (aka components) 5.1.6. Inheritance strategy 5.1.7. Mapping one to one and one to many associations 5.1.8. 自然 ID(natural-id) 5.1.9. Any 5.1.10. 屬性(Properties) 5.1.11. Some hbm.xml specificities 5.2. Hibernate 的類型 5.2.1. 實體(Entities)和值(values) 5.2.2. 基本值類型 5.2.3. 自定義值類型 5.3. 多次映射同一個類 5.4. SQL 中引號包圍的標(biāo)識符 5.5. 數(shù)據(jù)庫生成屬性(Generated Properties) 5.6. Column transformers: read and write expressions 5.7. 輔助數(shù)據(jù)庫對象(Auxiliary Database Objects)
6. Types 6.1. Value types 6.1.1. Basic value types 6.1.2. Composite types 6.1.3. Collection types 6.2. Entity types 6.3. Significance of type categories 6.4. Custom types 6.4.1. Custom types using org.hibernate.type.Type 6.4.2. Custom types using org.hibernate.usertype.UserType 6.4.3. Custom types using org.hibernate.usertype.CompositeUserType 6.5. Type registry
7. 集合映射(Collection mappings) 7.1. 持久化集合類(Persistent collections) 7.2. How to map collections 7.2.1. 集合外鍵(Collection foreign keys) 7.2.2. 索引集合類(Indexed collections) 7.2.3. Collections of basic types and embeddable objects 7.3. 高級集合映射(Advanced collection mappings) 7.3.1. 有序集合(Sorted collections) 7.3.2. 雙向關(guān)聯(lián)(Bidirectional associations) 7.3.3. 雙向關(guān)聯(lián),涉及有序集合類 7.3.4. 三重關(guān)聯(lián)(Ternary associations) 7.3.5. Using an <idbag> 7.4. 集合例子(Collection example)
8. 關(guān)聯(lián)關(guān)系映射 8.1. 介紹 8.2. 單向關(guān)聯(lián)(Unidirectional associations) 8.2.1. 多對一(many-to-one) 8.2.2. 一對一(One-to-one) 8.2.3. 一對多(one-to-many) 8.3. 使用連接表的單向關(guān)聯(lián)(Unidirectional associations with join tables) 8.3.1. 一對多(one-to-many) 8.3.2. 多對一(many-to-one) 8.3.3. 一對一(One-to-one) 8.3.4. 多對多(many-to-many) 8.4. 雙向關(guān)聯(lián)(Bidirectional associations) 8.4.1. 一對多(one to many)/多對一(many to one) 8.4.2. 一對一(One-to-one) 8.5. 使用連接表的雙向關(guān)聯(lián)(Bidirectional associations with join tables) 8.5.1. 一對多(one to many)/多對一(many to one) 8.5.2. 一對一(one to one) 8.5.3. 多對多(many-to-many) 8.6. 更復(fù)雜的關(guān)聯(lián)映射
9. 組件(Component)映射 9.1. 依賴對象(Dependent objects) 9.2. 在集合中出現(xiàn)的依賴對象(Collections of dependent objects) 9.3. 組件作為 Map 的索引(Components as Map indices ) 9.4. 組件作為聯(lián)合標(biāo)識符(Components as composite identifiers) 9.5. 動態(tài)組件(Dynamic components)
10. 繼承映射(Inheritance Mapping) 10.1. 三種策略 10.1.1. 每個類分層結(jié)構(gòu)一張表(Table per class hierarchy) 10.1.2. 每個子類一張表(Table per subclass) 10.1.3. 每個子類一張表(Table per subclass),使用辨別標(biāo)志(Discriminator) 10.1.4. 混合使用“每個類分層結(jié)構(gòu)一張表”和“每個子類一張表” 10.1.5. 每個具體類一張表(Table per concrete class) 10.1.6. 每個具體類一張表,使用隱式多態(tài) 10.1.7. 隱式多態(tài)和其他繼承映射混合使用 10.2. 限制
11. 與對象共事 11.1. Hibernate 對象狀態(tài)(object states) 11.2. 使對象持久化 11.3. 裝載對象 11.4. 查詢 11.4.1. 執(zhí)行查詢 11.4.2. 過濾集合 11.4.3. 條件查詢(Criteria queries) 11.4.4. 使用原生 SQL 的查詢 11.5. 修改持久對象 11.6. 修改脫管(Detached)對象 11.7. 自動狀態(tài)檢測 11.8. 刪除持久對象 11.9. 在兩個不同數(shù)據(jù)庫間復(fù)制對象 11.10. Session 刷出(flush) 11.11. 傳播性持久化(transitive persistence) 11.12. 使用元數(shù)據(jù)
12. Read-only entities 12.1. Making persistent entities read-only 12.1.1. Entities of immutable classes 12.1.2. Loading persistent entities as read-only 12.1.3. Loading read-only entities from an HQL query/criteria 12.1.4. Making a persistent entity read-only 12.2. Read-only affect on property type 12.2.1. Simple properties 12.2.2. Unidirectional associations 12.2.3. Bidirectional associations
13. 事務(wù)和并發(fā) 13.1. Session 和事務(wù)范圍(transaction scope) 13.1.1. 操作單元(Unit of work) 13.1.2. 長對話 13.1.3. 關(guān)注對象標(biāo)識(Considering object identity) 13.1.4. 常見問題 13.2. 數(shù)據(jù)庫事務(wù)聲明 13.2.1. 非托管環(huán)境 13.2.2. 使用 JTA 13.2.3. 異常處理 13.2.4. 事務(wù)超時 13.3. 樂觀并發(fā)控制(Optimistic concurrency control) 13.3.1. 應(yīng)用程序級別的版本檢查(Application version checking) 13.3.2. 擴(kuò)展周期的 session 和自動版本化 13.3.3. 脫管對象(deatched object)和自動版本化 13.3.4. 定制自動版本化行為 13.4. 悲觀鎖定(Pessimistic Locking) 13.5. 連接釋放模式(Connection Release Modes)
14. 攔截器與事件(Interceptors and events) 14.1. 攔截器(Interceptors) 14.2. 事件系統(tǒng)(Event system) 14.3. Hibernate 的聲明式安全機(jī)制
15. 批量處理(Batch processing) 15.1. 批量插入(Batch inserts) 15.2. 批量更新(Batch updates) 15.3. StatelessSession(無狀態(tài) session)接口 15.4. DML(數(shù)據(jù)操作語言)風(fēng)格的操作(DML-style operations)
16. HQL: Hibernate 查詢語言 16.1. 大小寫敏感性問題 16.2. from 子句 16.3. 關(guān)聯(lián)(Association)與連接(Join) 16.4. join 語法的形式 16.5. 引用 identifier 屬性 16.6. select 子句 16.7. 聚集函數(shù) 16.8. 多態(tài)查詢 16.9. where 子句 16.10. 表達(dá)式 16.11. order by 子句 16.12. group by 子句 16.13. 子查詢 16.14. HQL 示例 16.15. 批量的 UPDATE 和 DELETE 16.16. 小技巧 & 小竅門 16.17. 組件 16.18. Row value 構(gòu)造函數(shù)語法
17. 條件查詢(Criteria Queries) 17.1. 創(chuàng)建一個 Criteria 實例 17.2. 限制結(jié)果集內(nèi)容 17.3. 結(jié)果集排序 17.4. 關(guān)聯(lián) 17.5. 動態(tài)關(guān)聯(lián)抓取 17.6. 查詢示例 17.7. 投影(Projections)、聚合(aggregation)和分組(grouping) 17.8. 離線(detached)查詢和子查詢 17.9. 根據(jù)自然標(biāo)識查詢(Queries by natural identifier)
18. Native SQL 查詢 18.1. 使用 SQLQuery 18.1.1. 標(biāo)量查詢(Scalar queries) 18.1.2. 實體查詢(Entity queries) 18.1.3. 處理關(guān)聯(lián)和集合類(Handling associations and collections) 18.1.4. 返回多個實體(Returning multiple entities) 18.1.5. 返回非受管實體(Returning non-managed entities) 18.1.6. 處理繼承(Handling inheritance) 18.1.7. 參數(shù)(Parameters) 18.2. 命名 SQL 查詢 18.2.1. 使用 return-property 來明確地指定字段/別名 18.2.2. 使用存儲過程來查詢 18.3. 定制 SQL 用來 create,update 和 delete 18.4. 定制裝載 SQL
19. 過濾數(shù)據(jù) 19.1. Hibernate 過濾器(filters)
20. XML 映射 20.1. 用 XML 數(shù)據(jù)進(jìn)行工作 20.1.1. 指定同時映射 XML 和類 20.1.2. 只定義 XML 映射 20.2. XML 映射元數(shù)據(jù) 20.3. 操作 XML 數(shù)據(jù)
21. 提升性能 21.1. 抓取策略(Fetching strategies) 21.1.1. 操作延遲加載的關(guān)聯(lián) 21.1.2. 調(diào)整抓取策略(Tuning fetch strategies) 21.1.3. 單端關(guān)聯(lián)代理(Single-ended association proxies) 21.1.4. 實例化集合和代理(Initializing collections and proxies) 21.1.5. 使用批量抓取(Using batch fetching) 21.1.6. 使用子查詢抓取(Using subselect fetching) 21.1.7. Fetch profile(抓取策略) 21.1.8. 使用延遲屬性抓取(Using lazy property fetching) 21.2. 二級緩存(The Second Level Cache) 21.2.1. 緩存映射(Cache mappings) 21.2.2. 策略:只讀緩存(Strategy:read only) 21.2.3. 策略:讀寫/緩存(Strategy:read/write) 21.2.4. 策略:非嚴(yán)格讀/寫緩存(Strategy:nonstrict read/write) 21.2.5. 策略:事務(wù)緩存(transactional) 21.2.6. 各種緩存提供商/緩存并發(fā)策略的兼容性 21.3. 管理緩存(Managing the caches) 21.4. 查詢緩存(The Query Cache) 21.4.1. 啟用查詢緩存 21.4.2. 查詢緩存區(qū) 21.5. 理解集合性能(Understanding Collection performance) 21.5.1. 分類(Taxonomy) 21.5.2. Lists,maps 和 sets 用于更新效率最高 21.5.3. Bag 和 list 是反向集合類中效率最高的 21.5.4. 一次性刪除(One shot delete) 21.6. 監(jiān)測性能(Monitoring performance) 21.6.1. 監(jiān)測 SessionFactory 21.6.2. 數(shù)據(jù)記錄(Metrics)
22. 工具箱指南 22.1. Schema 自動生成(Automatic schema generation) 22.1.1. 對 schema 定制化(Customizing the schema) 22.1.2. 運(yùn)行該工具 22.1.3. 屬性(Properties) 22.1.4. 使用 Ant(Using Ant) 22.1.5. 對 schema 的增量更新(Incremental schema updates) 22.1.6. 用 Ant 來增量更新 schema(Using Ant for incremental schema updates) 22.1.7. Schema 校驗 22.1.8. 使用 Ant 進(jìn)行 schema 校驗
23. Additional modules 23.1. Bean Validation 23.1.1. Adding Bean Validation 23.1.2. Configuration 23.1.3. Catching violations 23.1.4. Database schema 23.2. Hibernate Search 23.2.1. Description 23.2.2. Integration with Hibernate Annotations
24. 示例:父子關(guān)系(Parent/Child) 24.1. 關(guān)于 collections 需要注意的一點(diǎn) 24.2. 雙向的一對多關(guān)系(Bidirectional one-to-many) 24.3. 級聯(lián)生命周期(Cascading lifecycle) 24.4. 級聯(lián)與未保存值(unsaved-value) 24.5. 結(jié)論
25. 示例:Weblog 應(yīng)用程序 25.1. 持久化類(Persistent Classes) 25.2. Hibernate 映射 25.3. Hibernate 代碼
26. 示例:復(fù)雜映射實例 26.1. Employer(雇主)/Employee(雇員) 26.2. Author(作家)/Work(作品) 26.3. Customer(客戶)/Order(訂單)/Product(產(chǎn)品) 26.4. 雜例 26.4.1. "Typed" 一對一關(guān)聯(lián) 26.4.2. 組合鍵示例 26.4.3. 共有組合鍵屬性的多對多(Many-to-many with shared composite key attribute) 26.4.4. 基于內(nèi)容的識別 26.4.5. 備用鍵的聯(lián)合
27. 最佳實踐(Best Practices) 28. 數(shù)據(jù)庫移植性考量 28.1. 移植性基礎(chǔ) 28.2. Dialect 28.3. 方言的使用 28.4. 標(biāo)識符的生成 28.5. 數(shù)據(jù)庫函數(shù) 28.6. 類型映射
總結(jié)
以上是生活随笔 為你收集整理的Hibernate Reference Documentation 的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔 網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔 推薦給好友。