Jean-Francois Leveque

Population de la base avec exemple des pays.

......@@ -100,14 +100,14 @@
<version>${assertj-core.version}</version>
<scope>test</scope>
</dependency>
<!--
<dependency>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa</artifactId>
<version>${openjpa.version}</version>
<scope>test</scope>
</dependency>
-->
<!-- to test with TomEE and Arquillian
<dependency>
<groupId>org.apache.tomee</groupId>
......@@ -149,6 +149,58 @@
<scope>test</scope>
</dependency>
-->
<!-- Hibernate -->
<dependency>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
<version>2.7.7</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>org.hibernate.common</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<version>5.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
<version>1.0.0.Final</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.2.3.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-ehcache</artifactId>
<version>5.2.3.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>5.2.3.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>5.2.3.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<version>3.3.0.Final</version>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.20.0-GA</version>
</dependency>
</dependencies>
<build>
......@@ -179,6 +231,7 @@
<context>ROOT</context>
</configuration>
</plugin>
<!--
<plugin>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-maven-plugin</artifactId>
......@@ -202,11 +255,12 @@
<dependency>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa</artifactId>
<!-- set the version to be the same as the level in your runtime -->
<- set the version to be the same as the level in your runtime
<version>${openjpa.version}</version>
</dependency>
</dependencies>
</plugin>
-->
</plugins>
</build>
......
......@@ -425,6 +425,7 @@ public class User /* extends org.roliste.data.DbTraceableEntity */ implements Di
/**
* The list of attributes / properties for this user.
*/
@OneToMany
private List<UserAttribute> userAttributes;
/**
......
......@@ -3,10 +3,13 @@
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="book-pu" transaction-type="JTA">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<jta-data-source>bookDatabase</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
<property name="hibernate.hbm2ddl.import_files" value="import.sql"/>
<!-- <property name="hibernate.hbm2ddl.import_files_sql_extractor" value="org.hibernate.tool.hbm2ddl.MultipleLinesSqlCommandExtractor" />-->
</properties>
</persistence-unit>
......
INSERT INTO Country VALUES (1, 'France');
INSERT INTO Country VALUES (2, 'Suisse');
INSERT INTO Country VALUES (4, 'Belgique');
INSERT INTO Country VALUES (5, 'Canada');
INSERT INTO Country VALUES (6, 'États-Unis d''Amérique');
INSERT INTO Country VALUES (7, 'Australie');
INSERT INTO Country VALUES (8, 'Espagne');
INSERT INTO Country VALUES (9, 'Portugal');
INSERT INTO Country VALUES (10, 'Royaume-Uni');
INSERT INTO Country VALUES (11, 'Allemagne');
INSERT INTO Country VALUES (12, 'Pologne');
\ No newline at end of file