O'Reilly logo

Beginning Hibernate: From Novice to Professional by Jeff Linwood, Dave Minter

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 6Mapping with Annotations

In Chapter 5, we discussed the need to create mappings between the database model and the object model. Mappings can be created as separate XML files, or as Java 5 annotations inline with the source code for your POJOs. In this chapter, we discuss the use of annotations, and in the next chapter, we will discuss the use of XML files.

Java 5 Features

Java 5 was introduced in late 2004 as a major new release of the language. Annotations are not supported by versions of Java prior to this, so while core Hibernate 3 is compatible with earlier versions, you will not be able to take advantage of the features described in this chapter unless your development, compilation, and runtime tools support at least version 5 ...

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