‐
Etape1Mise enplacedel'unitédepersistancedanslefichierMETA‐INF/persistence.xml
<?xml version="1.0"encoding="UTF‐8"?>
r
i
n
v
r
i
n="2
"xmln
="h
v
n
m
xml
n
r
i
n
"
<?xml version="1.0"encoding="UTF‐8"?>
r
i
n
v
r
i
n="2
"xmln
="h
v
n
m
xml
n
r
i
n
"
ttp://ja a.su .co / / s/pe s ste ce
xmlns:xsi="http://www.w3.org/2001/XMLSchema‐instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence‐unit name="jpa1"transaction‐type="RESOURCE_LOCAL">
org eclipse persistence jpa PersistenceProvider
ttp://ja a.su .co / / s/pe s ste ce
xmlns:xsi="http://www.w3.org/2001/XMLSchema‐instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence‐unit name="jpa1"transaction‐type="RESOURCE_LOCAL">
org eclipse persistence jpa PersistenceProvider
.
.
.
.
<class>jpa.Client</class>
<properties>
<property name="javax.persistence.jdbc.url"value="jdbc:derby://localhost:1527/bdJpa"/>
<property name="javax.persistence.jdbc.password"value="jpa"/>
.
.
.
.
<class>jpa.Client</class>
<properties>
<property name="javax.persistence.jdbc.url"value="jdbc:derby://localhost:1527/bdJpa"/>
<property name="javax.persistence.jdbc.password"value="jpa"/>
<property name="javax.persistence.jdbc.driver"
value="org.apache.derby.jdbc.ClientDriver"/>
<property name="javax.persistence.jdbc.user"value="jpa"/>
<property name="eclipselink.ddl‐generation"value="create‐tables"/>
<
ro
erties>
<property name="javax.persistence.jdbc.driver"
value="org.apache.derby.jdbc.ClientDriver"/>
<property name="javax.persistence.jdbc.user"value="jpa"/>
<property name="eclipselink.ddl‐generation"value="create‐tables"/>
<
ro
erties>
Etape2créationdel'entitédepersistance
</persistence‐unit>
</persistence>
</persistence‐unit>
</persistence>
package
pa;
importjavax.persistence.*;
@Entity
publicclassClientimplements Serializable {
private StringdateNaissance;
private StringdateCreation;
private int age;
private Stringemail;
package
pa;
importjavax.persistence.*;
@Entity
publicclassClientimplements Serializable {
private StringdateNaissance;
private StringdateCreation;
private int age;
private Stringemail;
private Longid;
private Stringprenom;
private Stringnom;
//Gméthodes get etset}
private Longid;
private Stringprenom;
private Stringnom;
//Gméthodes get etset}