Hibernate: A J2EE Developer's Guide (Paperback)
暫譯: Hibernate:J2EE 開發者指南 (平裝本)

Will Iverson

  • 出版商: Addison Wesley
  • 出版日期: 2004-11-21
  • 售價: $1,360
  • 貴賓價: 9.5$1,292
  • 語言: 英文
  • 頁數: 384
  • 裝訂: Paperback
  • ISBN: 0321268199
  • ISBN-13: 9780321268198
  • 相關分類: Java 相關技術
  • 立即出貨(限量) (庫存=1)

買這商品的人也買了...

相關主題

商品描述

Description:

Build fast, high-performance Java database applications with Hibernate.

Hibernate makes it far easier to build robust, high-performance database applications with Java. Now there's a practical, hands-on guide to using Hibernate's flexible, fast object/relational persistence and query services. Will Iverson covers every facet of development with Hibernate, from its mapping system toits advanced query mechanisms and transaction support.

Iverson shows you how to build Hibernate solutions that can integrate with Swing, with JSP, and even with EJBs utilizing bean-managed persistence. Using realistic examples, he demonstrates how to work with persistent objects, manage schema, and optimize database application performance. After you've mastered Hibernate's core techniques, Iverson presents best practices, tips, tricks, and style guidance for even more effective development. Coverage includes

  • Case study applications: starting from object/relational mapping files, Java code, and existing schema

  • Writing Hibernate queries using HQL—Hibernate's object-oriented SQL extension

  • Using Hibernate with Java-based Criteria and Example or native SQL

  • The Hibernate mapping file format in detail: a complete reference

  • How Hibernate handles class and database relationships

  • Managing session and database transactions with Hibernate

  • Tracking and optimizing performance with p6spy and IronTrack SQL

  • Automatically generating DDL scripts that create, update, and drop tables

Even if your Java database experience is limited to basic JDBC, this book will help you leverage Hibernate's remarkable power. You'll spend far less time writing code to bridge databases with Java applications—so you can get to market faster, with more features.

 

Table of Contents:

1. Overview.

    Why Object/Relational Mapping?

    What Is Hibernate?

    Comparing JDBC to Hibernate.

    Hibernate's Mapping System.

    Other Java/Database Integration Solutions.

      Enterprise JavaBeans (EJB) 2.X.

      Enterprise JavaBeans (EJB) 3.0.

      Java Data Objects (JDO).

      Other Commercial O/R Tools.

    How to Obtain and Install.

    Hibernate Distribution.

    Hibernate Extensions Distribution.

    Configuration.

      Supported Databases.

    Introduction to MySQL.

2. Getting Oriented.

    Application Architecture.

    Mapping Files.

      Mapping Files in Depth.

    Generating Java Source.

      Generated Persistent Classes.

    Application Configuration.

      Generated Database Schema.

    Web Application.

    JSP Interface.

      List Posts.

      Create Author.

      List Authors.

      Edit Author.

      Create Post.

      View Post.

      Edit Post.

      Delete Post.

      Delete Author.

      Next Steps.

3. Starting from Java.

    Java Object Model.

      Java Classes.

      Working with Xdoclet.

    Generated Mapping Files.

    Generated Schema.

    Working with Artifacts and Owners.

4. Starting from an Existing Schema.

    Initial Schema.

    Using Middlegen.

      Obtaining Middlegen.

      Configuring Middlegen.

      Running Middlegen.

    Generated Mapping Files.

    Generated Java.

    Working with the Database.

5. Mapping Files.

    Basic Structure.

    Mapping File Reference.

      any.

      array.

      bag.

      cache.

      class.

      collection-id.

      column.

      component.

      composite-element.

      composite-id.

      composite-index.

      discriminator.

      dynamic-component.

      element.

      generator.

      hibernate-mapping.

      id.

      idbag.

      import   -.

      index.

      index-many-to-any.

      index-many-to-many.

      joined-subclass.

      key.

      key-many-to-one.

      key-property.

      list.

      many-to-any.

      many-to-many.

      many-to-one.

      map.

      meta.

       meta-value.

      nested-composite-element.

      one-to-many.

      one-to-one.

      param.

      parent.

      primitive-array.

      property.

      query.

      return.

      set.

      sql-query.

      subclass.

      synchronize.

      timestamp.

      version.

6. Persistent Objects.

    Sessions.

      Setting up the Configuration.

      Obtaining the Session.

      Creating Objects.

      Finding Objects.

      Refreshing Objects.

      Deleting Objects.

      Updating Objects.

     Objects and Identity.

      What Is Identity?

      Identity within a Session.

      Generating Identity (Primary Keys).

      Built-In Hibernate Generators.

      Composite Identity.

      Unsaved Value.

    Life-Cycle Methods.

7. Relationships.

    Database Relationships.

      Many-to-One.

      One-to-Many.

      Many-to-Many.

      One-to-One.

    Java Collection Relationships.

    Java Class Relationships.

      Subclasses.

      Joined Subclasses.

      Components.

    Any-Based Relationships.

    Bi-directional Relationships.

8. Queries.

    HQL.

      Using Hibern8 IDE.

    HQL Reference.

      Notation Reference.

    Select.

      Selected Properties List.

      Aggregate.

      Collection Properties.

    From.

      Join Types.

    Where.

      Logical Operations.

      Boolean Operations.

      Quantified Expression.

      Parameter Binding.

    Group By.

    Having.

    Order By.

    Criteria Queries.

      Method Chaining.

      Easily Override Lazy Settings.

    Native SQL Queries.

9. Transactions.

    Introduction to Transactions.

      Sessions, Transactions, and Flushing.

    Optimistic and Pessimistic Locking.

      Pessimistic Locks.

      Optimistic Locks.

10. Performance.

    Finding and Solving Problems.

      IronTrack SQL.

    Queries.

      Lazy Objects.

      Collections.

    Inserts.

    Connection Pooling.

    Caching.

      Understanding Caches.

      Configuring a Cache.

      Standard Caches.

      Using a Custom Cache.

11. Schema Management.

    Updating an Existing Schema.

      Schema Updates from within an Application.

      Command Line Schema Updates.

      Ant Task Schema Updates.

    Generating Update and Drop Scripts.

      Command-Line Script Generation.

      Ant Task Script Generation.

      Generating Multiple Scripts.

12. Best Practices, Style Guide, Tips and Tricks.

    Reducing Code with Inversion of Control.

    Reducing Session Creation Impact with ThreadLocal.

    Using Hibernate as an EJB BMP Solution.

    Integrating with Other Technologies.

    Applications That Use Hibernate.

    Strategies for Getting Started.

      Where to Start?

      Start with Many-to-One and One-to-Many.

      Profile Database Fetching.

13. Future Directions.

    Hibernate 3.0.

    EJB 3.0.

    Here and Now.

Index.

商品描述(中文翻譯)

描述:
使用 Hibernate 快速構建高效能的 Java 資料庫應用程式。

Hibernate 使得使用 Java 構建穩健且高效能的資料庫應用程式變得更加容易。現在有一本實用的、動手操作的指南,介紹如何使用 Hibernate 的靈活且快速的物件/關聯持久性和查詢服務。Will Iverson 涵蓋了使用 Hibernate 開發的每一個面向,從其映射系統到其先進的查詢機制和交易支援。

Iverson 向您展示如何構建可以與 Swing、JSP 甚至使用 Bean 管理持久性的 EJB 整合的 Hibernate 解決方案。通過現實的範例,他演示了如何處理持久性物件、管理架構以及優化資料庫應用程式的效能。在掌握 Hibernate 的核心技術後,Iverson 提供了最佳實踐、技巧、竅門和風格指導,以便進行更有效的開發。內容包括:

- 案例研究應用程式:從物件/關聯映射檔案、Java 代碼和現有架構開始
- 使用 HQL 撰寫 Hibernate 查詢—Hibernate 的物件導向 SQL 擴展
- 使用 Hibernate 與基於 Java 的 Criteria 和 Example 或原生 SQL
- Hibernate 映射檔案格式詳細說明:完整參考
- Hibernate 如何處理類別和資料庫關係
- 使用 Hibernate 管理會話和資料庫交易
- 使用 p6spy 和 IronTrack SQL 追蹤和優化效能
- 自動生成 DDL 腳本以創建、更新和刪除資料表

即使您的 Java 資料庫經驗僅限於基本的 JDBC,本書也將幫助您利用 Hibernate 的卓越能力。您將花費更少的時間編寫代碼來橋接資料庫與 Java 應用程式—這樣您就可以更快地進入市場,並擁有更多功能。

目錄:
1. 概述。
- 為什麼要使用物件/關聯映射?
- 什麼是 Hibernate?
- 將 JDBC 與 Hibernate 進行比較。
- Hibernate 的映射系統。
- 其他 Java/資料庫整合解決方案。
- 企業 JavaBeans (EJB) 2.X。
- 企業 JavaBeans (EJB) 3.0。
- Java 資料物件 (JDO)。
- 其他商業 O/R 工具。
- 如何獲取和安裝。
- Hibernate 發行版。
- Hibernate 擴展發行版。
- 配置。
- 支援的資料庫。
- MySQL 介紹。

2. 開始導覽。
- 應用程式架構。
- 映射檔案。
- 深入了解映射檔案。
- 生成 Java 原始碼。
- 生成的持久性類別。
- 應用程式配置。
- 生成的資料庫架構。
- 網頁應用程式。
- JSP 介面。
- 列出文章。
- 創建作者。
- 列出作者。
- 編輯作者。
- 創建文章。
- 查看文章。
- 編輯文章。
- 刪除文章。
- 刪除作者。
- 下一步。

3. 從 Java 開始。
- Java 物件模型。
- Java 類別。
- 使用 Xdoclet。
- 生成的映射檔案。
- 生成的架構。
- 處理工件和擁有者。

4. 從現有架構開始。
- 初始架構。
- 使用 Middlegen。
- 獲取 Middlegen。
- 配置 Middlegen。
- 執行 Middlegen。
- 生成的映射檔案。
- 生成的 Java。
- 與資料庫互動。

5. 映射檔案。
- 基本結構。
- 映射檔案參考。
- any。
- array。
- bag。
- cache。
- class。