Hibernate in Action, Manning

Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio


Jump to: navigation, search
  Title:  Hibernate in Action
  Author(s):  Christian Bauer, Gavin King
  Edition:  Manning Publications; 1st edition (August 1, 2004)
  Format:  Paperback: 408 pages
  ISBN:  193239415X
  Overall Rating:  Image:stars5.gif The Bottom Line
C# Online.NET:Reviews: Book Reviews  •  Educ./Train. Reviews  •  Software Reviews  •  Top 10 Books

Contents


C# Online.NET Book Review

Hibernate is a popular, open source, Object-Relational (OR) Mapping tool in the Java Community. For .NET developers, there is NHibernate. Hibernate is designed to bridge the object-relational gap or "impedance" mismatch which requires an object to be mapped to a table row in order to be persisted. The problem—as with many open source projects—is that the online documentation leaves a lot to be desired, especially for the Hibernate newbie.

One could not ask for more authoritative authors: King is the founder of Hibernate; and, Bauer is a core Hibernate developer who works on the offical Hibernate documentation. Normally, the original developers are not the best technical writers or even the most lucid expounders of their own work. However, having written the best Hibernate book on the market, these two prove to be an exception.

The book is well written and well organized. The reader is not forced to read over material that good Java developers know already. Instead, the reader will learn enough about the inner workings of Hibernate to maximize its usefulness without getting bogged down in arcane technical detail. The opening chapters are almost worth the entire price of the book.

But, this is not a book for rank beginners. You are expected to be a Java developer with experience with relational databases. Furthermore, the book uses a single sample application—a complex online auction application featuring all types of relations—for illustrating concepts, design issues, optimizations, and problems and solutions. However, you will find code snippets rather than complete working examples ready to type in and run. The downloadable example is complete; but, the book does not attempt to guide you through it.

Although the technical information on Hibernate is available on the Web (hibernate.org), you will find that a book is necessary to get the most out of—or even just to get started properly with—Hibernate. Save yourself the time and aggravation by investing in a good book and supplementing it with the online Web documentation.

Hibernate3 will be backward compatible; so, virtually all of the book will apply equally well to Hibernate3. Any new features can easily be picked up from the Web. And, this will still be the best Hibernate book on the market until these authors produce a second edition.

All of the source code examples are in the Java language. However, the book still contains a wealth of useful material for .NET developers adopting NHibernate.


Bottom line

Hibernate in Action is the authoritative and definitive guide, tutorial, and reference.

Related titles

Other books in this series

Other reviews

"2005 Best Java Book!"
     —Java Developer's Journal

"This book is the first and only full tutorial, reference, and authoritative guide, and one of the most anticipated books of the year for Hibernate users."
     —Dr. Dobb's Journal

"Hibernate In Action has to be considered the definitive tome on Hibernate. As the authors are intimately involved with the project, the insight on Hibernate that they provide can't be easily duplicated. That said, the authors' own, often controversial, opinions on common design practices (DTOs for example) are sprinkled liberally throughout the text, and this may turn off some readers. Still, if your project is going to be using hibernate or is considering using Hibernate, this book is a must-have."
     —JavaRanch.com

From the back cover

Hibernate practically exploded on the Java scene. Why is this open-source tool so popular? Because it automates a tedious task: persisting your Java objects to a relational database. The inevitable mismatch between your object-oriented code and the relational database requires you to write code that maps one to the other. This code is often complex, tedious and costly to develop. Hibernate does the mapping for you.

Not only that, Hibernate makes it easy. Positioned as a layer between your application and your database, Hibernate takes care of loading and saving of objects. Hibernate applications are cheaper, more portable, and more resilient to change. And they perform better than anything you are likely to develop yourself.

Hibernate in Action carefully explains the concepts you need, then gets you going. It builds on a single example to show you how to use Hibernate in practice, how to deal with concurrency and transactions, how to efficiently retrieve objects and use caching.

The authors created Hibernate and they field questions from the Hibernate community every day - they know how to make Hibernate sing. Knowledge and insight seep out of every pore of this book.

What's Inside

  • ORM concepts
  • Getting started
  • Many real-world tasks
  • The Hibernate application development processes

About the author(s)

Christian Bauer is a member of the core Hibernate developer team and maintains the Hibernate documentation and website. He is a senior software engineer in Frankfurt, Germany.

Gavin King is the Hibernate founder and principal developer. He is a J2EE consultant based in Melbourne, Australia.

Table of Contents (abbreviated)

1 Understanding object/relational persistence 1
2 Introducing and integrating Hibernate 30
3 Mapping persistent classes 59
4 Working with persistent objects 114
5 Transactions, concurrency, and caching 154
6 Advanced mapping concepts 195
7 Retrieving objects efficiently 241
8 Writing Hibernate applications 294
9 Using the toolset 348
appendix A: SQL fundamentals 378
appendix B: ORM implementation strategies 382
appendix C: Back in the real world 388

Preface

Just because it is possible to push twigs along the ground with one's nose does not necessarily mean that that is the best way to collect firewood.

-Anthony Berglas

Today, many software developers work with Enterprise Information Systems (EIS). This kind of application creates, manages, and stores structured information and shares this information between many users in multiple physical locations.

The storage of EIS data involves massive usage of SQL-based database management systems. Every company we've met during our careers uses at least one SQL database; most are completely dependent on relational database technology at the core of their business.

In the past five years, broad adoption of the Java programming language has brought about the ascendancy of the object-oriented paradigm for software development. Developers are now sold on the benefits of object orientation. However, the vast majority of businesses are also tied to long-term investments in expensive relational database systems. Not only are particular vendor products entrenched, but existing legacy data must be made available to (and via) the shiny new object-oriented web applications.

However, the tabular representation of data in a relational system is fundamentally different than the networks of objects used in object-oriented Java applications. This difference has led to the so-called object/relational paradigm mismatch. Traditionally, the importance and cost of this mismatch have been underestimated, and tools for solving the mismatch have been insufficient. Meanwhile, Java developers blame relational technology for the mismatch; data professionals blame object technology.

Object/relational mapping (ORM) is the name given to automated solutions to the mismatch problem. For developers weary of tedious data access code, the good news is that ORM has come of age. Applications built with ORM middleware can be expected to be cheaper, more performant, less vendor-specific, and more able to cope with changes to the internal object or underlying SQL schema. The astonishing thing is that these benefits are now available to Java developers for free.

Gavin King began developing Hibernate in late 2001 when he found that the popular persistence solution at the time-CMP Entity Beans-didn't scale to nontrivial applications with complex data models. Hibernate began life as an independent, noncommercial open source project.

The Hibernate team (including the authors) has learned ORM the hard way-that is, by listening to user requests and implementing what was needed to satisfy those requests. The result, Hibernate, is a practical solution, emphasizing developer productivity and technical leadership. Hibernate has been used by tens of thousands of users and in many thousands of production applications.

When the demands on their time became overwhelming, the Hibernate team concluded that the future success of the project (and Gavin's continued sanity) demanded professional developers dedicated full-time to Hibernate. Hibernate joined jboss.org in late 2003 and now has a commercial aspect; you can purchase commercial support and training from JBoss Inc. But commercial training shouldn't be the only way to learn about Hibernate.

It's obvious that many, perhaps even most, Java projects benefit from the use of an ORM solution like Hibernate-although this wasn't obvious a couple of years ago! As ORM technology becomes increasingly mainstream, product documentation such as Hibernate's free user manual is no longer sufficient. We realized that the Hibernate community and new Hibernate users needed a full-length book, not only to learn about developing software with Hibernate, but also to understand and appreciate the object/relational mismatch and the motivations behind Hibernate's design.

The book you're holding was an enormous effort that occupied most of our spare time for more than a year. It was also the source of many heated disputes and learning experiences. We hope this book is an excellent guide to Hibernate (or, "the Hibernate bible," as one of our reviewers put it) and also the first comprehensive documentation of the object/relational mismatch and ORM in general. We hope you find it helpful and enjoy working with Hibernate.


Personal tools