Chapter 3. Working with Annotations
In this chapter, we will look at various annotations and how they are used. Most Hibernate and JPA annotations were created for a specific purpose. For that reason, annotations discussed in this chapter are grouped together according to what they are used for. Some annotations are specified in JPA and some are only available in Hibernate. We will mostly focus on Hibernate annotations, specifically the ones that are not documented well or may be tricky to use. The discussion on annotations is grouped based on the following:
- Mapping and association
- Behavior
- The SQL/DDL modifier
You may have noticed that so far we have avoided the Hibernate configuration file and mostly focused on annotations. This is actually the goal throughout this book, since most developers prefer using annotations. In this chapter, we will pay closer attention to some important annotations.