Toggle navigation
Toggle navigation
This project
Loading...
Sign in
grogv3
/
grog-cubi
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Jean-Francois Leveque
2016-10-07 18:48:22 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5aee45cfe8bfc26a15a67555c3b0c220b9b776f9
5aee45cf
1 parent
9f63801a
Population de la base avec exemple des pays.
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
4 deletions
pom.xml
src/main/java/org/legrog/entities/User.java
src/main/resources/META-INF/persistence.xml
src/main/webapp/WEB-INF/classes/import.sql
pom.xml
View file @
5aee45c
...
...
@@ -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>
...
...
src/main/java/org/legrog/entities/User.java
View file @
5aee45c
...
...
@@ -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
;
/**
...
...
src/main/resources/META-INF/persistence.xml
View file @
5aee45c
...
...
@@ -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>
...
...
src/main/webapp/WEB-INF/classes/import.sql
0 → 100644
View file @
5aee45c
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
Please
register
or
login
to post a comment