Refactoring des comptes vers dénomination Account : import.sql (non détecté par IDEA, oubli)
Showing
5 changed files
with
37 additions
and
8 deletions
... | @@ -173,6 +173,14 @@ | ... | @@ -173,6 +173,14 @@ |
173 | </dependency> | 173 | </dependency> |
174 | 174 | ||
175 | <dependency> | 175 | <dependency> |
176 | + <groupId>mysql</groupId> | ||
177 | + <artifactId>mysql-connector-java</artifactId> | ||
178 | + <!-- | ||
179 | + <version>5.1.6</version> | ||
180 | + --> | ||
181 | + </dependency> | ||
182 | + | ||
183 | + <dependency> | ||
176 | <groupId>org.springframework.data</groupId> | 184 | <groupId>org.springframework.data</groupId> |
177 | <artifactId>spring-data-jpa</artifactId> | 185 | <artifactId>spring-data-jpa</artifactId> |
178 | </dependency> | 186 | </dependency> | ... | ... |
... | @@ -10,7 +10,7 @@ public class JpaConfiguration { | ... | @@ -10,7 +10,7 @@ public class JpaConfiguration { |
10 | 10 | ||
11 | @Produces | 11 | @Produces |
12 | @RequestScoped | 12 | @RequestScoped |
13 | - @PersistenceContext(unitName = "book-pu") | 13 | + @PersistenceContext(unitName = "v3-pu") |
14 | public EntityManager entityManager; | 14 | public EntityManager entityManager; |
15 | 15 | ||
16 | } | 16 | } | ... | ... |
... | @@ -17,4 +17,18 @@ | ... | @@ -17,4 +17,18 @@ |
17 | </properties> | 17 | </properties> |
18 | </persistence-unit> | 18 | </persistence-unit> |
19 | 19 | ||
20 | + <persistence-unit name="v3-pu" transaction-type="JTA"> | ||
21 | + <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> | ||
22 | + <jta-data-source>v3Database</jta-data-source> | ||
23 | + <exclude-unlisted-classes>false</exclude-unlisted-classes> | ||
24 | + <properties> | ||
25 | + <property name="hibernate.hbm2ddl.auto" value="create-drop" /> | ||
26 | + <property name="hibernate.hbm2ddl.import_files" value="import.sql"/> | ||
27 | + <property name="hibernate.hbm2ddl.import_files_sql_extractor" value="org.hibernate.tool.hbm2ddl.MultipleLinesSqlCommandExtractor" /> | ||
28 | + <!-- DDL control OFF | ||
29 | + <property name="hibernate.show_sql" value="true"/> | ||
30 | + <property name="hibernate.format_sql" value="true"/> | ||
31 | + --> | ||
32 | + </properties> | ||
33 | + </persistence-unit> | ||
20 | </persistence> | 34 | </persistence> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -85,10 +85,10 @@ INSERT INTO AccountProperty (userPropertyId, name, tag, visible) VALUES | ... | @@ -85,10 +85,10 @@ INSERT INTO AccountProperty (userPropertyId, name, tag, visible) VALUES |
85 | (4, 'taille_listes', 'Nombre d''éléments affichés dans les listes', TRUE), | 85 | (4, 'taille_listes', 'Nombre d''éléments affichés dans les listes', TRUE), |
86 | (5,'skin', 'Thème visuel', TRUE); | 86 | (5,'skin', 'Thème visuel', TRUE); |
87 | 87 | ||
88 | -INSERT INTO Person_AccountRole VALUES (1,2); | ||
89 | -INSERT INTO Person_AccountRole VALUES (2,2); | ||
90 | -INSERT INTO Person_AccountRole VALUES (3,2); | ||
91 | -INSERT INTO Person_AccountRole VALUES (4,2); | ||
92 | -INSERT INTO Person_AccountRole VALUES (5,2); | ||
93 | -INSERT INTO Person_AccountRole VALUES (6,2); | ||
94 | -INSERT INTO Person_AccountRole VALUES (5,4); | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
88 | +INSERT INTO Account_AccountRole VALUES (1,2); | ||
89 | +INSERT INTO Account_AccountRole VALUES (2,2); | ||
90 | +INSERT INTO Account_AccountRole VALUES (3,2); | ||
91 | +INSERT INTO Account_AccountRole VALUES (4,2); | ||
92 | +INSERT INTO Account_AccountRole VALUES (5,2); | ||
93 | +INSERT INTO Account_AccountRole VALUES (6,2); | ||
94 | +INSERT INTO Account_AccountRole VALUES (5,4); | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -6,4 +6,11 @@ | ... | @@ -6,4 +6,11 @@ |
6 | UserName = sa | 6 | UserName = sa |
7 | JtaManaged= true | 7 | JtaManaged= true |
8 | </Resource> | 8 | </Resource> |
9 | + <Resource id="v3Database" type="javax.sql.DataSource"> | ||
10 | + JdbcDriver = com.mysql.jdbc.Driver | ||
11 | + JdbcUrl = jdbc:mysql://localhost/v2?useSSL=false | ||
12 | + UserName = grogdev | ||
13 | + password = grogdev | ||
14 | + JtaManaged= true | ||
15 | + </Resource> | ||
9 | </tomee> | 16 | </tomee> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment