O'Reilly logo

Hibernate Recipes: A Problem-Solution Approach by GARY MAK, SRINIVAS GURUZU

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 2. Basic Mapping and Object Identity

A primary key in a database table is used to uniquely identify a record in that table. The primary key value can't be null and is unique within a table. The primary key is also used to establish a relationship between two tables—it's defined as a foreign key in the associated table. Because the primary key is used to identify a particular record, it can also be called the database identifier. The database identifier is exposed to the application by Hibernate through an identifier property of the persistent entity. This chapter discusses the various ways to generate an identifier (primary key) for a database record. You learn about metadata configurations and their effect on the persistence mechanism. ...

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