O'Reilly logo

Beginning Hibernate, Third Edition by Jeff Linwood, Dave Minter, Joseph B. Ottinger

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 5

image

An Overview of Mapping

The purpose of Hibernate is to allow you to treat your database as if it stores Java objects. However, in practice, relational databases do not store objects—they store data in tables and columns. Unfortunately, there is no simple way to correlate the data stored in a relational database with the data represented by Java objects.1

The difference between an object-oriented association and a relational one is fundamental. Consider a simple class to represent a user, and another to represent an email address, as shown in Figure 5-1.

Figure 5-1. An object-oriented association

User objects contain fields referring ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required