Skip to content
Snippets Groups Projects
Commit aa2c2d68 authored by Paul Cancel's avatar Paul Cancel
Browse files

Ajout persistence pour jpa

parent 1277c778
Branches
No related tags found
No related merge requests found
......@@ -35,6 +35,18 @@
<version>6.1.0</version>
<scope>provided</scope>
</dependency>
<!-- JPA -->
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.jpa</artifactId>
<version>4.0.3</version>
</dependency>
<!-- EclipseLink -->
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>4.0.3</version>
</dependency>
</dependencies>
<build>
......
drop table if exists utilisateur, rendezvous, calendrier, requete, demande;
drop table if exists utilisateur, rendezvous, calendrier, requete, rendezvous;
create table utilisateur(
email text primary key not null,
......@@ -6,13 +6,20 @@ create table utilisateur(
prenom text,
telephone decimal(10,0),
date_naissance date,
mot_de_passe text
mot_de_passe text,
isAdmin boolean
);
create table calendrier(
date_jour date primary key
);
create table creneaux(
heure hour,
minute minute,
occupe boolean default false
);
create table requete(
rno serial primary key,
motif text,
......@@ -32,6 +39,6 @@ create table rendezvous(
insert into calendrier values(TO_DATE('20/09/2024','DD/MM/YYYY'));
insert into utilisateur values ('theo.vienne.etu@univ-lille.fr', 'Theo', 'Vienne', 0619515793, TO_DATE('31/08/2000','DD/MM/YYYY'), 'theovienne');
insert into utilisateur values ('theo.vienne.etu@univ-lille.fr', 'Theo', 'Vienne', 0619515793, TO_DATE('31/08/2000','DD/MM/YYYY'), 'theovienne', true);
insert into requete(motif, description) values ('Rhume', 'Douleur au crane');
insert into rendezvous values('theo.vienne.etu@univ-lille.fr',1,TO_DATE('20/09/2024','DD/MM/YYYY'));
\ No newline at end of file
<persistence version="3.0" xmlns="http://xmlns.jcp.org/xml/ns/persistence">
<persistence-unit name="pu" transaction-type="RESOURCE_LOCAL">
<class>sae.doctolib.dto.User</class>
<properties>
<property name="jakarta.persistence.jdbc.url" value="jdbc:postgresql://psqlserv/but3"/>
<property name="jakarta.persistence.jdbc.user" value="paulcanceletu"/>
<property name="jakarta.persistence.jdbc.password" value="moi"/>
<property name="jakarta.persistence.schema-generation.database.action" value="drop-and-create"/>
<property name="jakarta.persistence.sql-load-script-source" value="script.sql"/>
<property name="jakarta.persistence.schema-generation.scripts.action" value="drop-and-create"/>
<property name="jakarta.persistence.schema-generation.scripts.create-target" value="create.sql"/>
<property name="jakarta.persistence.schema-generation.scripts.drop-target" value="destroy.sql"/>
<property name="eclipselink.logging.level" value="FINE"/>
</properties>
</persistence-unit>
</persistence>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment