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 6

image

Mapping with Annotations

In Chapter 5, we discussed the need to create mappings between the database model and the object model. Mappings can be created in two different ways: via inline annotations (as we’ve done through the book so far), or as separate XML files in one of two primary formats.

The XML-based mapping is rarely used outside of situations where mapping an object model to a preexisting schema is required; even then, adept use of the annotations can match the XML configuration’s features.

Creating Hibernate Mappings with Annotations

Prior to the inline annotations, the only way to create mappings was through XML files—although ...

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