-
Book Overview & Buying
-
Table Of Contents
IBM WebSphere eXtreme Scale 6
By :
Conceptually, a persistent entity is an object that can be saved to some data store. EJB 1.0 introduced us to entity beans, though they were difficult to use. Since then, several different flavors of object persistence frameworks have evolved. Although eXtreme Scale Entities have no technical relation to other object persistence frameworks, the concept remains the same. We define a class as an Entity, and then store instances of that class in a data store.
Defining a class as an Entity is done using either Java Annotations or XML configuration in Java 5.0 or higher. Pre-Java 5.0 environments can only use XML configuration. The Java Annotations we use to define Entities are in the com.ibm.websphere.projector.annotations package.
Let's see how we define an Entity using annotations:
public class Payment implements Serializable {
private String cardNumber;
private String street;
private String city;
private String state;
private BigDecimal amount; // getters and setters...
Change the font size
Change margin width
Change background colour