Controlling the Object-Relationship Mapping (ORM) process

Object-Relationship Mapping (ORM) is concerned with persisting an object to a database. There exist a number of annotations which provide information to guide the mapping process. The uses of these annotations are illustrated in this recipe.

Getting ready

When we persist an entity it is sometimes desirable to exercise more control over which table in a database should be used. In addition, we may want to specify the field names to use within the table. ORM allows us to control these factors by using the @Table and @Column annotations. The use of these annotations will be demonstrated by expanding upon the previous recipe and augmenting the EntityBeanApplication application.

How to do it... ...

Get EJB 3.1 Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.