Hibernate: A Developer's Notebook
暫譯: Hibernate:開發者筆記本

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 的新開發者筆記系列:
開發者筆記是一個新的書籍系列,涵蓋了軟體開發人員重要的新工具。開發者筆記強調範例重於解釋,實踐重於理論。它們是通過實作學習;通過實驗工具並發現有效的方法。「全是實驗,沒有講座」,並有一位深思熟慮的實驗夥伴引導您。

目錄
前言

第一章 安裝與設置
獲取 Ant 發行版
獲取 HSQLDB 資料庫引擎
獲取 Hibernate
設置專案層級

第二章 映射介紹
編寫映射文件
生成一些類
構建架構
將 Hibernate 連接到 MySQL

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

第四章 集合與關聯
映射集合
持久化集合
檢索集合
使用雙向關聯
處理簡單集合

第五章 更豐富的關聯
使用延遲關聯
有序集合
增強集合中的關聯
生命週期關聯
反射關聯

第六章 持久化列舉類型
定義持久化列舉類型
使用持久化列舉

第七章 自定義值類型
定義用戶類型
使用自定義類型映射
構建複合用戶類型

第八章 條件查詢
使用簡單條件
複合條件
將條件應用於關聯
依範例查詢

第九章 HQL 概覽
編寫 HQL 查詢
選擇屬性和片段
排序
處理聚合值
編寫原生 SQL 查詢

附錄 A Hibernate 類型

附錄 B 標準條件

附錄 C Hibernate SQL 方言

索引