Java Persistence with Hibernate

Book description

Java Persistence with Hibernate explores Hibernate by developing an application that ties together hundreds of individual examples. You'll immediately dig into the rich programming model of Hibernate 3.2 and Java Persistence, working through queries, fetching strategies, caching, transactions, conversations, and more. You'll also appreciate the well-illustrated discussion of best practices in database design, object/relational mapping, and optimization techniques.

In this revised edition of Manning's bestselling Hibernate in Action, authors Christian Bauer and Gavin King—the founder of the Hibernate project—cover Hibernate 3.2 in detail along with the EJB 3.0 and Java Persistence 1.0 standards.

The book ends with detailed coverage of JBoss Seam, a revolutionary web application framework for Java EE that builds on EJB 3.0, JavaServer Faces, and Hibernate concepts.



About the Technology

Persistence—the ability of data to outlive an instance of a program—is central to modern applications. Hibernate, the most popular Java persistence tool, provides automatic and transparent object/relational mapping so it's a snap to work with SQL databases in Java applications. Hibernate conforms to the new EJB 3.0 and Java Persistence 1.0 standards.



About the Book


What's Inside
  • O/R mapping concepts
  • Get started with Hibernate and Java Persistence
  • Efficient database application design
  • Comprehensive Hibernate and Java Persistence reference
  • Unmatched breadth and depth


About the Reader


About the Authors

Christian Bauer is a member of the Hibernate developer team and a trainer, consultant, and product manager for Hibernate, EJB 3.0, and JBoss Seam at JBoss.

Gavin King, a lead developer at JBoss, is the founder of the Hibernate project, and a member of the EJB 3.0 (JSR 220) expert group. He also leads the Web Beans JSR 299, a standardization effort involving Hibernate concepts, JSF, and EJB 3.0.



Quotes
...this book is the ultimate solution. If you are going to use Hibernate in your application, you have no other choice, go rush to the store and get this book.
- Meera Subbarao, JavaLobby

"Java Persistence with Hibernate" is the most comprehensive, authoritative and definitive guide, tutorial, and reference to OR-mapped Java persistence.
- Will Wagers, C#online.net

A definitive source on Hibernate. Great for any developer.
- Patrick Peak, CTO, BrowserMedia, Author of Hibernate Quickly

I wholeheartedly recommend this book!
- Stuart Caborn, Thoughtworks

Great topic, great content, and there is a great need for this book!
- Ryan Daigle, RTP Region, ALTERthought

...very thorough, very complete. I highly recommend it.
- Patrick Dennis, Java Developer Management Dynamics Inc.

A must-read for developers using Hibernate.
- Dan Dobrin, BEA Systems

It's the best book out there about Hibernate (and there are quite a few on the market right now), maybe even the best book about ORM in Java, in general.
- Adrian Spinei, Real Life, beta version

Table of contents

  1. Praise for the First Edition
  2. foreword to the revised edition
  3. foreword to the first edition
  4. preface to the revised edition
  5. preface to the first edition
  6. acknowledgments
  7. about this book
  8. about the cover illustration
  9. Getting started with Hibernate and EJB 3.0
    1. Understanding object/relational persistence
      1. What is persistence?
      2. The paradigm mismatch
      3. Persistence layers and alternatives
      4. Object/relational mapping
      5. Summary
    2. Starting a project
      1. Starting a Hibernate project
      2. Starting a Java Persistence project
      3. Reverse engineering a legacy database
      4. Integration with Java EE services
      5. Summary
    3. Domain models and metadata
      1. The CaveatEmptor application
      2. Implementing the domain model
      3. Object/relational mapping metadata
      4. Alternative entity representation
      5. Summary
  10. Mapping concepts and strategies
    1. Mapping persistent classes
      1. Understanding entities and value types
      2. Mapping entities with identity
      3. Class mapping options
      4. Fine-grained models and mappings
      5. Summary
    2. Inheritance and custom types
      1. Mapping class inheritance
      2. The Hibernate type system
      3. Creating custom mapping types
      4. Summary
    3. Mapping collections and entity associations
      1. Sets, bags, lists, and maps of value types
      2. Collections of components
      3. Mapping collections with annotations
      4. Mapping a parent/children relationship
      5. Summary
    4. Advanced entity association mappings
      1. Single-valued entity associations
      2. Many-valued entity associations
      3. Polymorphic associations
      4. Summary
    5. Legacy databases and custom SQL
      1. Integrating legacy databases
      2. Customizing SQL
      3. Improving schema DDL
      4. Summary
  11. Conversational object processing
    1. Working with objects
      1. The persistence lifecycle
      2. Object identity and equality
      3. The Hibernate interfaces
      4. The Java Persistence API
      5. Using Java Persistence in EJB components
      6. Summary
    2. Transactions and concurrency
      1. Transaction essentials
      2. Controlling concurrent access
      3. Nontransactional data access
      4. Summary
    3. Implementing conversations
      1. Propagating the Hibernate Session
      2. Conversations with Hibernate
      3. Conversations with JPA
      4. Conversations with EJB 3.0
      5. Summary
    4. Modifying objects efficiently
      1. Transitive persistence
      2. Bulk and batch operations
      3. Data filtering and interception
      4. Summary
    5. Optimizing fetching and caching
      1. Defining the global fetch plan
      2. Selecting a fetch strategy
      3. Caching fundamentals
      4. Caching in practice
      5. Summary
    6. Querying with HQL and JPA QL
      1. Creating and running queries
      2. Basic HQL and JPA QL queries
      3. Joins, reporting queries, and subselects
      4. Summary
    7. Advanced query options
      1. Querying with criteria and example
      2. Using native SQL queries
      3. Filtering collections
      4. Caching query results
      5. Summary
    8. Creating and testing layered applications
      1. Hibernate in a web application
      2. Creating a persistence layer
      3. Introducing the Command pattern
      4. Designing applications with EJB 3.0
      5. Testing
      6. Summary
    9. Introducing JBoss Seam
      1. The Java EE 5.0 programming model
      2. Improving the application with Seam
      3. Understanding contextual components
      4. Validating user input
      5. Simplifying persistence with Seam
      6. Summary
  12. SQL fundamentals
  13. Mapping quick reference
  14. references
    1. references

Product information

  • Title: Java Persistence with Hibernate
  • Author(s): Gavin King, Christian Bauer
  • Release date: October 2006
  • Publisher(s): Manning Publications
  • ISBN: 9781932394887