What is required for JPA?
The following components are required for JPA:
A relational database. We shall be using the Oracle database 10g or XE. But, any database may be used. The databases supported by EclipseLink JPA shall be discussed in the next section.
Entity classes. An Entity class is just a POJO annotated with the
@Entity
annotation:@Entity public class Catalog implements Serializable { ...}
We shall discuss in a later chapter why the class is implementing the
Serializable
interface.A
persistence.xml
configuration file. Thepersistence.xml
file specifies the target database, the target server, the entities that are mapped to the database, and other properties, which we shall discuss in a later section.Metadata. Object relational mapping in EJB 3.0 is implemented using metadata, which may be specified using metadata annotations or in an object relational mapping XML file that conforms to the
http://java.sun.com/xml/ns/persistence/orm_1_0.xsd
XML Schema. If metadata annotations are...