© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
J. B. Ottinger et al.Beginning Hibernate 6https://doi.org/10.1007/978-1-4842-7337-1_6

6. Mapping with Annotations

Joseph B. Ottinger1  , Jeff Linwood2 and Dave Minter3
(1)
Youngsville, NC, USA
(2)
Austin, TX, USA
(3)
London, UK
 

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 (Hibernate’s internal XML format and JPA’s mapping format, both of which have value but are not suggested for most applications).

The XML-based mapping is rarely used outside ...

Get Beginning Hibernate 6: Java Persistence from Beginner to Pro now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.