O'Reilly logo

IBM WebSphere eXtreme Scale 6 by Anthony Chaves

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

Entity relationships

The Payment class holds a little too much information. Namely, it holds address information and that address data should exist in its own class. Each payment has address data associated with it. This is where we discover Entity relationships.

If you're familiar with object-relational mapping, you may recall that there are at least four types of relationship between classes. In eXtreme Scale terms, the relationships are defined by annotations in the com.ibm.websphere.projector.annotations package. Those relationships are @OneToOne, @OneToMany, @ManyToOne, and @ManyToMany. At first, we'll model the Payment-Address relationship as one-to-one.

First, we'll define the Address class:

@Entity public class Address { @Id private int ...

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