Java Reference
In-Depth Information
JPA in action
JPA is based on the concept of entities, in order to make object-relational mapping
possible. An entity is a simple Java class (like POJO ) with @Entity annotation (or
name in the database. In addition to the @Entity annotation, an entity class must
have at least one primary key equivalent attribute that is designated with the @Id
annotation (or XML equivalent). For the other attributes of the entity, the provider as-
sociates each of them to the column having the same name in the table, as shown
in the following screenshot:
The parameters that indicate the database that will be associated to a set of entities
must be defined in the persistence unit within the persistence.xml file of your
The following code is an example of the persistence unit of a Java SE Application:
<?xml version="1.0" encoding="UTF-8"?>
Search WWH ::

Custom Search