In modern applications, persistence is not merely a matter of an application saving and restoring its state. A persistence mechanism organizes and structures persistent data. It manages concurrent access to that data. It ensures integrity of the data. Most importantly, it provides a mechanism to sort, search and aggregate data. In many cases, a relational database is the lowest common denominator in an heterogenous software environment.
Object-oriented development is most powerful when entities in the business domain are modelled using purely object-oriented notions like inheritence, polymorphism, encapsulation and association. Unfortunately, the SQL-based relational databases found in almost all enterprise environments do not properly support these modelling techniques. Hence, many applications implement two different models of the some business entities. Transformations between the Java object model and the persistent relational model are often complex, tedious and costly to implement.
Object/Relational Mapping (ORM) is the name given to automated solutions to this transformation problem - known as the object/relational impedance mismatch. For developers weary of tedious persistence code, the good news is that ORM has finally come of age. Applications built with an ORM tool can be expected to be cheaper, more performant, more portable and more resilient in the face of changes to the internal object or underlying relational models. The most astonishing thing is that these benefits are now available to Java developers for free - Hibernate is a mature open source ORM solution for Java that is being used with great success in many different problem domains.
Hibernate in Action is both an introduction to the theoretical aspects of automated object/relational mapping and a practical guide to the use of Hibernate. The extensive example code implements an online auction application.
The book is divided into two parts. Part I discusses object persistence, the object/relational mismatch problem and emphasizes the importance of Plain Old Java Objects. It introduces Hibernate and explains the basic theoretical foundations of object/relational mapping.
Part II is dedicated to demonstrating more advanced ORM concepts and techniques, with practical examples using Hibernate. The impact of ORM upon application architecture and development processes is explored along with techniques for achieving high performance. Hibernate's developer toolset is demonstrated and best practices are recommended.
In-depth coverage of ORM concepts
Practical ORM examples with Hibernate
Solutions to real-world problems with an example application
Discussion of development processes, application architecture and best practices
Introduction to popular open source tools (XDoclet, Middlegen, Ant) for roundtrip development with Hibernate