Jean-Francois Leveque

Suppression d'un champ non maintenable (éditeur actif) et adaptations pour migration éditeur.

1 tee creeV3Publisher+Version+Action.log 1 tee creeV3Publisher+Version+Action.log
2 2
3 +SET foreign_key_checks = 0;
4 +
3 create table Publisher ( 5 create table Publisher (
4 publisherId int(11) NOT NULL AUTO_INCREMENT, 6 publisherId int(11) NOT NULL AUTO_INCREMENT,
5 - validatedVersion int(11), 7 + validatedVersion_publisherVersionId int(11),
6 PRIMARY KEY ('publisherId') 8 PRIMARY KEY ('publisherId')
7 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 9 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
8 10
9 -insert into Publisher (publisherId, validatedVersion) 11 +insert into Publisher (publisherId, validatedVersion_publisherVersionId)
10 select ID_EDITEUR, ID_EDITEUR from editeur; 12 select ID_EDITEUR, ID_EDITEUR from editeur;
11 13
12 create table PublisherVersion ( 14 create table PublisherVersion (
...@@ -22,7 +24,6 @@ create table PublisherVersion ( ...@@ -22,7 +24,6 @@ create table PublisherVersion (
22 publisherTelephone varchar(25), 24 publisherTelephone varchar(25),
23 publisherEmail varchar(50), 25 publisherEmail varchar(50),
24 publisherURL varchar(100), 26 publisherURL varchar(100),
25 - publisherActive TINYINT(1),
26 publisherHistory longtext, 27 publisherHistory longtext,
27 publisherVersionAuthor_userId int(11), 28 publisherVersionAuthor_userId int(11),
28 publisherVersionDatetime DATETIME, 29 publisherVersionDatetime DATETIME,
...@@ -33,10 +34,10 @@ insert into PublisherVersion (publisherVersionId, publisher_publisherId, ...@@ -33,10 +34,10 @@ insert into PublisherVersion (publisherVersionId, publisher_publisherId,
33 publisherName, publisherStreetAddress, publisherPostalCode, 34 publisherName, publisherStreetAddress, publisherPostalCode,
34 publisherPostOfficeBoxNumber, publisherAddressRegion, 35 publisherPostOfficeBoxNumber, publisherAddressRegion,
35 publisherAddressLocality, publisherAddressCountry_countryId, 36 publisherAddressLocality, publisherAddressCountry_countryId,
36 - publisherTelephone, publisherEmail, publisherURL, publisherActive, 37 + publisherTelephone, publisherEmail, publisherURL,
37 publisherHistory, publisherVersionAuthor_userId, publisherVersionDatetime) 38 publisherHistory, publisherVersionAuthor_userId, publisherVersionDatetime)
38 select ID_EDITEUR, ID_EDITEUR, NOM_EDITEUR, ADR_EDITEUR, CP_EDITEUR, NULL, 39 select ID_EDITEUR, ID_EDITEUR, NOM_EDITEUR, ADR_EDITEUR, CP_EDITEUR, NULL,
39 - NULL, VILLE, countryId, TEL_EDITEUR, EMAIL_EDITEUR, URL_EDITEUR, NULL, 40 + NULL, VILLE, countryId, TEL_EDITEUR, EMAIL_EDITEUR, URL_EDITEUR,
40 HISTORIQUE, ID_UTILISATEUR, DATE_ACTION 41 HISTORIQUE, ID_UTILISATEUR, DATE_ACTION
41 from editeur e 42 from editeur e
42 left join Country on countryName = e.PAYS 43 left join Country on countryName = e.PAYS
...@@ -45,7 +46,7 @@ where j.DATE_ACTION = (select max(DATE_ACTION) from journal j2 ...@@ -45,7 +46,7 @@ where j.DATE_ACTION = (select max(DATE_ACTION) from journal j2
45 where j2.ID_JOURNALISABLE = e.ID_EDITEUR) 46 where j2.ID_JOURNALISABLE = e.ID_EDITEUR)
46 union 47 union
47 select ID_EDITEUR, ID_EDITEUR, NOM_EDITEUR, ADR_EDITEUR, CP_EDITEUR, NULL, 48 select ID_EDITEUR, ID_EDITEUR, NOM_EDITEUR, ADR_EDITEUR, CP_EDITEUR, NULL,
48 - NULL, VILLE, countryId, TEL_EDITEUR, EMAIL_EDITEUR, URL_EDITEUR, NULL, 49 + NULL, VILLE, countryId, TEL_EDITEUR, EMAIL_EDITEUR, URL_EDITEUR,
49 HISTORIQUE, null, null 50 HISTORIQUE, null, null
50 from editeur e 51 from editeur e
51 left join Country on countryName = e.PAYS 52 left join Country on countryName = e.PAYS
...@@ -72,6 +73,8 @@ where j.DATE_ACTION = (select max(DATE_ACTION) from journal j2 ...@@ -72,6 +73,8 @@ where j.DATE_ACTION = (select max(DATE_ACTION) from journal j2
72 where j2.ID_JOURNALISABLE = e.ID_EDITEUR) 73 where j2.ID_JOURNALISABLE = e.ID_EDITEUR)
73 ; 74 ;
74 75
76 +SET foreign_key_checks = 1;
77 +
75 show create table Publisher; 78 show create table Publisher;
76 79
77 show create table PublisherVersion; 80 show create table PublisherVersion;
......
...@@ -28,7 +28,7 @@ public class PublisherVersion { ...@@ -28,7 +28,7 @@ public class PublisherVersion {
28 private String publisherTelephone; 28 private String publisherTelephone;
29 private String publisherEmail; 29 private String publisherEmail;
30 private String publisherURL; 30 private String publisherURL;
31 - private boolean publisherActive; 31 + @Lob
32 private String publisherHistory; 32 private String publisherHistory;
33 @ManyToOne 33 @ManyToOne
34 private Account publisherVersionAuthor; 34 private Account publisherVersionAuthor;
...@@ -42,14 +42,6 @@ public class PublisherVersion { ...@@ -42,14 +42,6 @@ public class PublisherVersion {
42 this.publisherVersionDatetime = publisherVersionDatetime; 42 this.publisherVersionDatetime = publisherVersionDatetime;
43 } 43 }
44 44
45 - public boolean isPublisherActive() {
46 - return publisherActive;
47 - }
48 -
49 - public void setPublisherActive(boolean publisherActive) {
50 - this.publisherActive = publisherActive;
51 - }
52 -
53 public String getPublisherHistory() { 45 public String getPublisherHistory() {
54 return publisherHistory; 46 return publisherHistory;
55 } 47 }
...@@ -160,7 +152,7 @@ public class PublisherVersion { ...@@ -160,7 +152,7 @@ public class PublisherVersion {
160 publisherStreetAddress + ", CP = " + publisherPostalCode + ", BP = " + publisherPostOfficeBoxNumber + 152 publisherStreetAddress + ", CP = " + publisherPostalCode + ", BP = " + publisherPostOfficeBoxNumber +
161 ", Region = " + publisherAddressRegion + ", Ville = " + publisherAddressLocality + ", Pays = " + 153 ", Region = " + publisherAddressRegion + ", Ville = " + publisherAddressLocality + ", Pays = " +
162 publisherAddressCountry + ", Telephone = " + publisherTelephone + ", email = " + publisherEmail + 154 publisherAddressCountry + ", Telephone = " + publisherTelephone + ", email = " + publisherEmail +
163 - ", URL = " + publisherURL + ", actif = " + publisherActive + ", History = " + publisherHistory + 155 + ", URL = " + publisherURL + ", History = " + publisherHistory +
164 ", Version Author = " + publisherVersionAuthor + ", Version DateTime = " + publisherVersionDatetime; 156 ", Version Author = " + publisherVersionAuthor + ", Version DateTime = " + publisherVersionDatetime;
165 } 157 }
166 158
......
...@@ -41,7 +41,6 @@ public class PublisherVersionView implements Serializable { ...@@ -41,7 +41,6 @@ public class PublisherVersionView implements Serializable {
41 private String publisherTelephone; 41 private String publisherTelephone;
42 private String publisherEmail; 42 private String publisherEmail;
43 private String publisherURL; 43 private String publisherURL;
44 - private boolean publisherActive;
45 private String publisherHistory; 44 private String publisherHistory;
46 private transient Account publisherVersionAuthor; 45 private transient Account publisherVersionAuthor;
47 private Timestamp publisherVersionDatetime; 46 private Timestamp publisherVersionDatetime;
...@@ -86,7 +85,6 @@ public class PublisherVersionView implements Serializable { ...@@ -86,7 +85,6 @@ public class PublisherVersionView implements Serializable {
86 publisherTelephone = null; 85 publisherTelephone = null;
87 publisherEmail = null; 86 publisherEmail = null;
88 publisherURL = null; 87 publisherURL = null;
89 - publisherActive = false;
90 publisherHistory = null; 88 publisherHistory = null;
91 // Je ne pense pas que la ligne suivante soit nécessaire 89 // Je ne pense pas que la ligne suivante soit nécessaire
92 publisher = null; 90 publisher = null;
...@@ -108,7 +106,6 @@ public class PublisherVersionView implements Serializable { ...@@ -108,7 +106,6 @@ public class PublisherVersionView implements Serializable {
108 106
109 private PublisherVersion getNewPublisherVersion() { 107 private PublisherVersion getNewPublisherVersion() {
110 PublisherVersion publisherVersion = new PublisherVersion(); 108 PublisherVersion publisherVersion = new PublisherVersion();
111 - publisherVersion.setPublisherActive(publisherActive);
112 publisherVersion.setPublisherAddressCountry(publisherAddressCountry); 109 publisherVersion.setPublisherAddressCountry(publisherAddressCountry);
113 publisherVersion.setPublisherAddressLocality(publisherAddressLocality); 110 publisherVersion.setPublisherAddressLocality(publisherAddressLocality);
114 publisherVersion.setPublisherAddressRegion(publisherAddressRegion); 111 publisherVersion.setPublisherAddressRegion(publisherAddressRegion);
...@@ -149,8 +146,8 @@ public class PublisherVersionView implements Serializable { ...@@ -149,8 +146,8 @@ public class PublisherVersionView implements Serializable {
149 } 146 }
150 147
151 public void update() { 148 public void update() {
152 - logger.trace("debut update, attributs locaux, publisherActive = {} publisherAddressCountry = {} publisherAddressLocality = {} publisherAddressRegion = {} publisherEmail = {} publisherHistory = {} publisherName = {} publisherPostalCode = {} publisherPostOfficeBoxNumber = {} publisherStreetAddress = {} publisherTelephone {} publisherURL {}", 149 + logger.trace("debut update, attributs locaux, publisherAddressCountry = {} publisherAddressLocality = {} publisherAddressRegion = {} publisherEmail = {} publisherHistory = {} publisherName = {} publisherPostalCode = {} publisherPostOfficeBoxNumber = {} publisherStreetAddress = {} publisherTelephone {} publisherURL {}",
153 - publisherActive, publisherAddressCountry, publisherAddressLocality, publisherAddressRegion, 150 + publisherAddressCountry, publisherAddressLocality, publisherAddressRegion,
154 publisherEmail, publisherHistory, publisherName, publisherPostalCode, publisherPostOfficeBoxNumber, 151 publisherEmail, publisherHistory, publisherName, publisherPostalCode, publisherPostOfficeBoxNumber,
155 publisherStreetAddress, publisherTelephone, publisherURL); 152 publisherStreetAddress, publisherTelephone, publisherURL);
156 153
...@@ -191,7 +188,6 @@ public class PublisherVersionView implements Serializable { ...@@ -191,7 +188,6 @@ public class PublisherVersionView implements Serializable {
191 publisherTelephone = publisherVersion.getPublisherTelephone(); 188 publisherTelephone = publisherVersion.getPublisherTelephone();
192 publisherEmail = publisherVersion.getPublisherEmail(); 189 publisherEmail = publisherVersion.getPublisherEmail();
193 publisherURL = publisherVersion.getPublisherURL(); 190 publisherURL = publisherVersion.getPublisherURL();
194 - publisherActive = publisherVersion.isPublisherActive();
195 publisherHistory = publisherVersion.getPublisherHistory(); 191 publisherHistory = publisherVersion.getPublisherHistory();
196 publisher = publisherVersion.getPublisher(); 192 publisher = publisherVersion.getPublisher();
197 193
...@@ -296,14 +292,6 @@ public class PublisherVersionView implements Serializable { ...@@ -296,14 +292,6 @@ public class PublisherVersionView implements Serializable {
296 this.publisherURL = publisherURL; 292 this.publisherURL = publisherURL;
297 } 293 }
298 294
299 - public boolean isPublisherActive() {
300 - return publisherActive;
301 - }
302 -
303 - public void setPublisherActive(boolean publisherActive) {
304 - this.publisherActive = publisherActive;
305 - }
306 -
307 public String getPublisherHistory() { 295 public String getPublisherHistory() {
308 return publisherHistory; 296 return publisherHistory;
309 } 297 }
......
...@@ -65,10 +65,6 @@ ...@@ -65,10 +65,6 @@
65 ${action.publisherVersion.publisherURL} 65 ${action.publisherVersion.publisherURL}
66 </h:column> 66 </h:column>
67 <h:column> 67 <h:column>
68 - <f:facet name="header">Active ?</f:facet>
69 - ${action.publisherVersion.publisherActive}
70 - </h:column>
71 - <h:column>
72 <f:facet name="header">History</f:facet> 68 <f:facet name="header">History</f:facet>
73 ${action.publisherVersion.publisherHistory} 69 ${action.publisherVersion.publisherHistory}
74 </h:column> 70 </h:column>
......
...@@ -94,10 +94,6 @@ ...@@ -94,10 +94,6 @@
94 ${version.publisherURL} 94 ${version.publisherURL}
95 </h:column> 95 </h:column>
96 <h:column> 96 <h:column>
97 - <f:facet name="header">Active ?</f:facet>
98 - ${version.publisherActive}
99 - </h:column>
100 - <h:column>
101 <f:facet name="header">History</f:facet> 97 <f:facet name="header">History</f:facet>
102 ${version.publisherHistory} 98 ${version.publisherHistory}
103 </h:column> 99 </h:column>
......
...@@ -53,9 +53,6 @@ ...@@ -53,9 +53,6 @@
53 <label for="publisherURL">publisherURL</label> 53 <label for="publisherURL">publisherURL</label>
54 <input type="text" id="publisherURL" jsf:value='#{publisherVersionView.publisherURL}' jsf:disabled="#{not publisherVersionView.editMode}"/> 54 <input type="text" id="publisherURL" jsf:value='#{publisherVersionView.publisherURL}' jsf:disabled="#{not publisherVersionView.editMode}"/>
55 55
56 - <label for="publisherActive">publisherActive</label>
57 - <input type="checkbox" id="publisherActive" jsf:disabled="#{not publisherVersionView.editMode}" jsf:value="#{publisherVersionView.publisherActive}"/>
58 -
59 <label for="publisherHistory">publisherHistory</label> 56 <label for="publisherHistory">publisherHistory</label>
60 <textarea id="publisherHistory" rows="" cols="" jsf:disabled="#{not publisherVersionView.editMode}" jsf:value="#{publisherVersionView.publisherHistory}"/> 57 <textarea id="publisherHistory" rows="" cols="" jsf:disabled="#{not publisherVersionView.editMode}" jsf:value="#{publisherVersionView.publisherHistory}"/>
61 58
......
...@@ -22,6 +22,9 @@ ...@@ -22,6 +22,9 @@
22 <jta-data-source>v3Database</jta-data-source> 22 <jta-data-source>v3Database</jta-data-source>
23 <exclude-unlisted-classes>false</exclude-unlisted-classes> 23 <exclude-unlisted-classes>false</exclude-unlisted-classes>
24 <properties> 24 <properties>
25 + <property name="hibernate.connection.CharSet" value="utf8"/>
26 + <property name="hibernate.connection.characterEncoding" value="utf8"/>
27 + <property name="hibernate.connection.useUnicode" value="true"/>
25 <property name="hibernate.hbm2ddl.auto" value="create-drop" /> 28 <property name="hibernate.hbm2ddl.auto" value="create-drop" />
26 <property name="hibernate.hbm2ddl.import_files" value="import.sql"/> 29 <property name="hibernate.hbm2ddl.import_files" value="import.sql"/>
27 <property name="hibernate.hbm2ddl.import_files_sql_extractor" value="org.hibernate.tool.hbm2ddl.MultipleLinesSqlCommandExtractor" /> 30 <property name="hibernate.hbm2ddl.import_files_sql_extractor" value="org.hibernate.tool.hbm2ddl.MultipleLinesSqlCommandExtractor" />
......
...@@ -58,7 +58,6 @@ public class PublisherVersionViewTest { ...@@ -58,7 +58,6 @@ public class PublisherVersionViewTest {
58 publisherVersion.setPublisherTelephone("G"); 58 publisherVersion.setPublisherTelephone("G");
59 publisherVersion.setPublisherEmail("H"); 59 publisherVersion.setPublisherEmail("H");
60 publisherVersion.setPublisherURL("I"); 60 publisherVersion.setPublisherURL("I");
61 - publisherVersion.setPublisherActive(true);
62 publisherVersion.setPublisherHistory("J"); 61 publisherVersion.setPublisherHistory("J");
63 publisherVersion.setPublisher(new Publisher()); 62 publisherVersion.setPublisher(new Publisher());
64 63
...@@ -97,7 +96,6 @@ public class PublisherVersionViewTest { ...@@ -97,7 +96,6 @@ public class PublisherVersionViewTest {
97 assertThat(publisherVersionView.getPublisherEmail()).isNull(); 96 assertThat(publisherVersionView.getPublisherEmail()).isNull();
98 assertThat(publisherVersionView.getPublisherURL()).isNull(); 97 assertThat(publisherVersionView.getPublisherURL()).isNull();
99 assertThat(publisherVersionView.getPublisherHistory()).isNull(); 98 assertThat(publisherVersionView.getPublisherHistory()).isNull();
100 - assertThat(publisherVersionView.isPublisherActive()).isFalse();
101 assertThat(publisherVersionView.isEditMode()).isTrue(); 99 assertThat(publisherVersionView.isEditMode()).isTrue();
102 } 100 }
103 101
...@@ -117,7 +115,6 @@ public class PublisherVersionViewTest { ...@@ -117,7 +115,6 @@ public class PublisherVersionViewTest {
117 publisherVersionView.setPublisherTelephone("7"); 115 publisherVersionView.setPublisherTelephone("7");
118 publisherVersionView.setPublisherEmail("8"); 116 publisherVersionView.setPublisherEmail("8");
119 publisherVersionView.setPublisherURL("9"); 117 publisherVersionView.setPublisherURL("9");
120 - publisherVersionView.setPublisherActive(false);
121 publisherVersionView.setPublisherHistory("10"); 118 publisherVersionView.setPublisherHistory("10");
122 119
123 publisherVersionView.cancel(); 120 publisherVersionView.cancel();
...@@ -163,7 +160,6 @@ public class PublisherVersionViewTest { ...@@ -163,7 +160,6 @@ public class PublisherVersionViewTest {
163 assertThat(publisherVersionView.getPublisherTelephone()).isEqualTo("G"); 160 assertThat(publisherVersionView.getPublisherTelephone()).isEqualTo("G");
164 assertThat(publisherVersionView.getPublisherEmail()).isEqualTo("H"); 161 assertThat(publisherVersionView.getPublisherEmail()).isEqualTo("H");
165 assertThat(publisherVersionView.getPublisherURL()).isEqualTo("I"); 162 assertThat(publisherVersionView.getPublisherURL()).isEqualTo("I");
166 - assertThat(publisherVersionView.isPublisherActive()).isTrue();
167 assertThat(publisherVersionView.getPublisherHistory()).isEqualTo("J"); 163 assertThat(publisherVersionView.getPublisherHistory()).isEqualTo("J");
168 assertThat(publisherVersionView.isNewPublisher()).isFalse(); 164 assertThat(publisherVersionView.isNewPublisher()).isFalse();
169 } 165 }
...@@ -277,7 +273,6 @@ public class PublisherVersionViewTest { ...@@ -277,7 +273,6 @@ public class PublisherVersionViewTest {
277 publisherVersionView.setPublisherTelephone("7"); 273 publisherVersionView.setPublisherTelephone("7");
278 publisherVersionView.setPublisherEmail("8"); 274 publisherVersionView.setPublisherEmail("8");
279 publisherVersionView.setPublisherURL("9"); 275 publisherVersionView.setPublisherURL("9");
280 - publisherVersionView.setPublisherActive(true);
281 publisherVersionView.setPublisherHistory("10"); 276 publisherVersionView.setPublisherHistory("10");
282 publisherVersionView.setPublisher(publisherMock); 277 publisherVersionView.setPublisher(publisherMock);
283 } 278 }
...@@ -349,7 +344,6 @@ public class PublisherVersionViewTest { ...@@ -349,7 +344,6 @@ public class PublisherVersionViewTest {
349 publisherVersionView.setPublisherTelephone("G"); 344 publisherVersionView.setPublisherTelephone("G");
350 publisherVersionView.setPublisherEmail("H"); 345 publisherVersionView.setPublisherEmail("H");
351 publisherVersionView.setPublisherURL("I"); 346 publisherVersionView.setPublisherURL("I");
352 - publisherVersionView.setPublisherActive(true);
353 publisherVersionView.setPublisherHistory("J"); 347 publisherVersionView.setPublisherHistory("J");
354 publisherVersionView.setPublisher(publisherMock); 348 publisherVersionView.setPublisher(publisherMock);
355 } 349 }
......