Hibernate: A Developer's Notebook

James Elliott

  • 出版商: O'Reilly
  • 出版日期: 2004-06-15
  • 定價: $825
  • 售價: 5.0$413
  • 語言: 英文
  • 頁數: 192
  • 裝訂: Paperback
  • ISBN: 0596006969
  • ISBN-13: 9780596006969
  • 相關分類: Java 相關技術
  • 立即出貨

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

商品描述

Do you enjoy writing software, except for the database code? Hibernate:A Developer's Notebook is for you.

Database experts may enjoy fiddling with SQL, but you don't have to--the rest of the application is the fun part. And even database experts dread the tedious plumbing and typographical spaghetti needed to put their SQL into a Java program. Hibernate: A Developers Notebook shows you how to use Hibernate to automate persistence: you write natural Java objects and some simple configuration files, and Hibernate automates all the interaction between your objects and the database. You don't even need to know the database is there, and you can change from one database to another simply by changing a few statements in a configuration file.

Hibernate: A Developer's Notebook walks you through the ins and outs of using Hibernate, from installation and configuration, to complex associations and composite types. Two chapters explore ways to write sophisticated queries, which you can express either through a pure Java API, or with an SQL-inspired, but object-oriented, query language. Don't let that intimidate you though: one of the biggest surprises in working with Hibernate is that for many of the common real-world application scenarios, you don't need an explicit query at all.

If you've needed to add a database backend to your application, don't put it off. It's much more fun than it used to be, and Hibernate: A Developer's Notebook shows you why.

Here's what a few reviewers had to say:

"I'm sitting on an airplane after finishing Hibernate: A Developer's Notebook. It's rare to find a book on a new Java technology that you can get through on a domestic flight. That this notebook effectively and succinctly tackles object-relational mapping makes it, and Hibernate, even more impressive. Many books in this category would need to be checked luggage. With this book, you travel first class." --Mike Clark

"A simple persistence framework deserves a simple book, and this one delivers. The examples are well described and easy to understand, yet sophisticated enough to demonstrate Hibernate in a real-world context. Jim, I'm a new fan." --Bruce Tate


About the new Developer's Notebook Series from O'Reilly:
Developer's Notebooks are a new book series covering important new tools for software developers. Developer's Notebooks stress example over explanation and practice over theory. They are about learning by doing; by experimenting with tools and discovering what works. "All lab,no lecture," with a thoughtful lab partner to guide the way

Table of Contents

Preface

Chapter 1. Installation and Setup
     Getting an Ant Distribution
     Getting the HSQLDB Database Engine
     Getting Hibernate
     Setting Up a Project Hierarchy

Chapter 2. Introduction to Mapping
     Writing a Mapping Document
     Generating Some Class
     Cooking Up a Schema
     Connecting Hibernate to MySQL

Chapter 3. Harnessing Hibernate
     Creating Persistent Objects
     Finding Persistent Objects
     Better Ways to Build Queries

Chapter 4. Collections and Associations
     Mapping Collections
     Persisting Collections
     Retrieving Collections
     Using Bidirectional Associations
     Working with Simple Collections

Chapter 5. Richer Associations
     Using Lazy Associations
     Ordered Collections
     Augmenting Associations in Collections
     Lifecycle Associations
     Reflexive Associations

Chapter 6. Persistent Enumerated Types
     Defining a Persistent Enumerated Type
     Working with Persistent Enumerations

Chapter 7. Custom Value Types
     Defining a User Type
     Using a Custom Type Mapping
     Building a Composite User Type

Chapter 8. Criteria Queries
     Using Simple Criteria
     Compounding Criteria
     Applying Criteria to Associations
     Querying by Example

Chapter 9. A Look at HQL
     Writing HQL Queries
     Selecting Properties and Pieces
     Sorting
     Working with Aggregate Values
     Writing Native SQL Queries

Appendix A. Hibernate Types

Appendix B. Standard Criteria

Appendix C. Hibernate SQL Dialects

Index

商品描述(中文翻譯)

你喜歡寫軟體嗎?除了資料庫程式碼之外。《Hibernate: A Developer's Notebook》就是為你而設的。資料庫專家可能喜歡玩弄SQL,但你不需要這樣做-應用程式的其餘部分才是有趣的部分。即使是資料庫專家也討厭冗長的管道和錯綜複雜的程式碼,這些都是將SQL放入Java程式所需的。《Hibernate: A Developer's Notebook》向你展示如何使用Hibernate自動化持久性:你只需編寫自然的Java物件和一些簡單的配置文件,Hibernate就會自動處理物件和資料庫之間的所有交互作用。你甚至不需要知道資料庫的存在,只需在配置文件中更改幾個語句,就可以從一個資料庫切換到另一個資料庫。

《Hibernate: A Developer's Notebook》將帶領你深入了解使用Hibernate的方方面面,從安裝和配置到複雜的關聯和複合類型。兩章介紹了撰寫複雜查詢的方法,你可以通過純Java API或類似SQL但面向對象的查詢語言來表達。不過,不要被嚇到:在使用Hibernate的常見實際應用場景中,許多情況下根本不需要明確的查詢。

如果你需要為應用程式添加資料庫後端,不要再拖延了。現在的情況比以前有趣得多,《Hibernate: A Developer's Notebook》將向你展示其中的原因。

以下是一些評論家的評論:

“我在飛機上讀完《Hibernate: A Developer's Notebook》。在國內航班上能夠閱讀完一本關於新的Java技術的書是很少見的。這本筆記本有效而簡潔地介紹了物件關聯映射,這使得它和Hibernate更加令人印象深刻。在這個類別中,許多書籍需要托運。而這本書,你可以坐頭等艙。” - Mike Clark

“一個簡單的持久性框架值得一本簡單的書,而這本書做到了。這些例子描述得很好,易於理解,但又足夠複雜,以展示Hibernate在實際應用情境中的用法。Jim,我是你的新粉絲。” - Bruce Tate

關於O'Reilly的新《Developer's Notebook》系列:

《Developer's Notebook》是一個新的書籍系列,涵蓋了軟體開發人員的重要新工具。《Developer's Notebook》強調實例而非解釋,實踐而非理論。它們是關於通過實踐學習的,通過實驗工具並發現有效方法。這是一個“全實驗,無講座”的系列,有一個周到的實驗夥伴指導著前進。

目錄:

前言

第1章 安裝和設置
- 獲取Ant發行版
- 獲取HSQLDB資料庫引擎
- 獲取Hibernate
- 設置項目層次結構

第2章 映射介紹
- 撰寫映射文件
- 生成一些類
- 創建模式
- 將Hibernate連接到MySQL

第3章 利用Hibernate
- 創建持久物件
- 查找持久物件
- 更好的構建查詢的方法

第4章 集合和關聯
- 映射集合
- 持久化集合
- 檢索集合
- 使用雙向關聯
- 使用簡單集合

第5章 更豐富的關聯
- 使用延遲關聯
- 有序集合