Jean-Francois Leveque

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

tee creeV3Publisher+Version+Action.log
SET foreign_key_checks = 0;
create table Publisher (
publisherId int(11) NOT NULL AUTO_INCREMENT,
validatedVersion int(11),
validatedVersion_publisherVersionId int(11),
PRIMARY KEY ('publisherId')
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
insert into Publisher (publisherId, validatedVersion)
insert into Publisher (publisherId, validatedVersion_publisherVersionId)
select ID_EDITEUR, ID_EDITEUR from editeur;
create table PublisherVersion (
......@@ -22,7 +24,6 @@ create table PublisherVersion (
publisherTelephone varchar(25),
publisherEmail varchar(50),
publisherURL varchar(100),
publisherActive TINYINT(1),
publisherHistory longtext,
publisherVersionAuthor_userId int(11),
publisherVersionDatetime DATETIME,
......@@ -33,10 +34,10 @@ insert into PublisherVersion (publisherVersionId, publisher_publisherId,
publisherName, publisherStreetAddress, publisherPostalCode,
publisherPostOfficeBoxNumber, publisherAddressRegion,
publisherAddressLocality, publisherAddressCountry_countryId,
publisherTelephone, publisherEmail, publisherURL, publisherActive,
publisherTelephone, publisherEmail, publisherURL,
publisherHistory, publisherVersionAuthor_userId, publisherVersionDatetime)
select ID_EDITEUR, ID_EDITEUR, NOM_EDITEUR, ADR_EDITEUR, CP_EDITEUR, NULL,
NULL, VILLE, countryId, TEL_EDITEUR, EMAIL_EDITEUR, URL_EDITEUR, NULL,
NULL, VILLE, countryId, TEL_EDITEUR, EMAIL_EDITEUR, URL_EDITEUR,
HISTORIQUE, ID_UTILISATEUR, DATE_ACTION
from editeur e
left join Country on countryName = e.PAYS
......@@ -45,7 +46,7 @@ where j.DATE_ACTION = (select max(DATE_ACTION) from journal j2
where j2.ID_JOURNALISABLE = e.ID_EDITEUR)
union
select ID_EDITEUR, ID_EDITEUR, NOM_EDITEUR, ADR_EDITEUR, CP_EDITEUR, NULL,
NULL, VILLE, countryId, TEL_EDITEUR, EMAIL_EDITEUR, URL_EDITEUR, NULL,
NULL, VILLE, countryId, TEL_EDITEUR, EMAIL_EDITEUR, URL_EDITEUR,
HISTORIQUE, null, null
from editeur e
left join Country on countryName = e.PAYS
......@@ -72,6 +73,8 @@ where j.DATE_ACTION = (select max(DATE_ACTION) from journal j2
where j2.ID_JOURNALISABLE = e.ID_EDITEUR)
;
SET foreign_key_checks = 1;
show create table Publisher;
show create table PublisherVersion;
......
......@@ -28,7 +28,7 @@ public class PublisherVersion {
private String publisherTelephone;
private String publisherEmail;
private String publisherURL;
private boolean publisherActive;
@Lob
private String publisherHistory;
@ManyToOne
private Account publisherVersionAuthor;
......@@ -42,14 +42,6 @@ public class PublisherVersion {
this.publisherVersionDatetime = publisherVersionDatetime;
}
public boolean isPublisherActive() {
return publisherActive;
}
public void setPublisherActive(boolean publisherActive) {
this.publisherActive = publisherActive;
}
public String getPublisherHistory() {
return publisherHistory;
}
......@@ -160,7 +152,7 @@ public class PublisherVersion {
publisherStreetAddress + ", CP = " + publisherPostalCode + ", BP = " + publisherPostOfficeBoxNumber +
", Region = " + publisherAddressRegion + ", Ville = " + publisherAddressLocality + ", Pays = " +
publisherAddressCountry + ", Telephone = " + publisherTelephone + ", email = " + publisherEmail +
", URL = " + publisherURL + ", actif = " + publisherActive + ", History = " + publisherHistory +
", URL = " + publisherURL + ", History = " + publisherHistory +
", Version Author = " + publisherVersionAuthor + ", Version DateTime = " + publisherVersionDatetime;
}
......
......@@ -41,7 +41,6 @@ public class PublisherVersionView implements Serializable {
private String publisherTelephone;
private String publisherEmail;
private String publisherURL;
private boolean publisherActive;
private String publisherHistory;
private transient Account publisherVersionAuthor;
private Timestamp publisherVersionDatetime;
......@@ -86,7 +85,6 @@ public class PublisherVersionView implements Serializable {
publisherTelephone = null;
publisherEmail = null;
publisherURL = null;
publisherActive = false;
publisherHistory = null;
// Je ne pense pas que la ligne suivante soit nécessaire
publisher = null;
......@@ -108,7 +106,6 @@ public class PublisherVersionView implements Serializable {
private PublisherVersion getNewPublisherVersion() {
PublisherVersion publisherVersion = new PublisherVersion();
publisherVersion.setPublisherActive(publisherActive);
publisherVersion.setPublisherAddressCountry(publisherAddressCountry);
publisherVersion.setPublisherAddressLocality(publisherAddressLocality);
publisherVersion.setPublisherAddressRegion(publisherAddressRegion);
......@@ -149,8 +146,8 @@ public class PublisherVersionView implements Serializable {
}
public void update() {
logger.trace("debut update, attributs locaux, publisherActive = {} publisherAddressCountry = {} publisherAddressLocality = {} publisherAddressRegion = {} publisherEmail = {} publisherHistory = {} publisherName = {} publisherPostalCode = {} publisherPostOfficeBoxNumber = {} publisherStreetAddress = {} publisherTelephone {} publisherURL {}",
publisherActive, publisherAddressCountry, publisherAddressLocality, publisherAddressRegion,
logger.trace("debut update, attributs locaux, publisherAddressCountry = {} publisherAddressLocality = {} publisherAddressRegion = {} publisherEmail = {} publisherHistory = {} publisherName = {} publisherPostalCode = {} publisherPostOfficeBoxNumber = {} publisherStreetAddress = {} publisherTelephone {} publisherURL {}",
publisherAddressCountry, publisherAddressLocality, publisherAddressRegion,
publisherEmail, publisherHistory, publisherName, publisherPostalCode, publisherPostOfficeBoxNumber,
publisherStreetAddress, publisherTelephone, publisherURL);
......@@ -191,7 +188,6 @@ public class PublisherVersionView implements Serializable {
publisherTelephone = publisherVersion.getPublisherTelephone();
publisherEmail = publisherVersion.getPublisherEmail();
publisherURL = publisherVersion.getPublisherURL();
publisherActive = publisherVersion.isPublisherActive();
publisherHistory = publisherVersion.getPublisherHistory();
publisher = publisherVersion.getPublisher();
......@@ -296,14 +292,6 @@ public class PublisherVersionView implements Serializable {
this.publisherURL = publisherURL;
}
public boolean isPublisherActive() {
return publisherActive;
}
public void setPublisherActive(boolean publisherActive) {
this.publisherActive = publisherActive;
}
public String getPublisherHistory() {
return publisherHistory;
}
......
......@@ -65,10 +65,6 @@
${action.publisherVersion.publisherURL}
</h:column>
<h:column>
<f:facet name="header">Active ?</f:facet>
${action.publisherVersion.publisherActive}
</h:column>
<h:column>
<f:facet name="header">History</f:facet>
${action.publisherVersion.publisherHistory}
</h:column>
......
......@@ -94,10 +94,6 @@
${version.publisherURL}
</h:column>
<h:column>
<f:facet name="header">Active ?</f:facet>
${version.publisherActive}
</h:column>
<h:column>
<f:facet name="header">History</f:facet>
${version.publisherHistory}
</h:column>
......
......@@ -53,9 +53,6 @@
<label for="publisherURL">publisherURL</label>
<input type="text" id="publisherURL" jsf:value='#{publisherVersionView.publisherURL}' jsf:disabled="#{not publisherVersionView.editMode}"/>
<label for="publisherActive">publisherActive</label>
<input type="checkbox" id="publisherActive" jsf:disabled="#{not publisherVersionView.editMode}" jsf:value="#{publisherVersionView.publisherActive}"/>
<label for="publisherHistory">publisherHistory</label>
<textarea id="publisherHistory" rows="" cols="" jsf:disabled="#{not publisherVersionView.editMode}" jsf:value="#{publisherVersionView.publisherHistory}"/>
......
......@@ -22,6 +22,9 @@
<jta-data-source>v3Database</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="hibernate.connection.CharSet" value="utf8"/>
<property name="hibernate.connection.characterEncoding" value="utf8"/>
<property name="hibernate.connection.useUnicode" value="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" />
......
......@@ -58,7 +58,6 @@ public class PublisherVersionViewTest {
publisherVersion.setPublisherTelephone("G");
publisherVersion.setPublisherEmail("H");
publisherVersion.setPublisherURL("I");
publisherVersion.setPublisherActive(true);
publisherVersion.setPublisherHistory("J");
publisherVersion.setPublisher(new Publisher());
......@@ -97,7 +96,6 @@ public class PublisherVersionViewTest {
assertThat(publisherVersionView.getPublisherEmail()).isNull();
assertThat(publisherVersionView.getPublisherURL()).isNull();
assertThat(publisherVersionView.getPublisherHistory()).isNull();
assertThat(publisherVersionView.isPublisherActive()).isFalse();
assertThat(publisherVersionView.isEditMode()).isTrue();
}
......@@ -117,7 +115,6 @@ public class PublisherVersionViewTest {
publisherVersionView.setPublisherTelephone("7");
publisherVersionView.setPublisherEmail("8");
publisherVersionView.setPublisherURL("9");
publisherVersionView.setPublisherActive(false);
publisherVersionView.setPublisherHistory("10");
publisherVersionView.cancel();
......@@ -163,7 +160,6 @@ public class PublisherVersionViewTest {
assertThat(publisherVersionView.getPublisherTelephone()).isEqualTo("G");
assertThat(publisherVersionView.getPublisherEmail()).isEqualTo("H");
assertThat(publisherVersionView.getPublisherURL()).isEqualTo("I");
assertThat(publisherVersionView.isPublisherActive()).isTrue();
assertThat(publisherVersionView.getPublisherHistory()).isEqualTo("J");
assertThat(publisherVersionView.isNewPublisher()).isFalse();
}
......@@ -277,7 +273,6 @@ public class PublisherVersionViewTest {
publisherVersionView.setPublisherTelephone("7");
publisherVersionView.setPublisherEmail("8");
publisherVersionView.setPublisherURL("9");
publisherVersionView.setPublisherActive(true);
publisherVersionView.setPublisherHistory("10");
publisherVersionView.setPublisher(publisherMock);
}
......@@ -349,7 +344,6 @@ public class PublisherVersionViewTest {
publisherVersionView.setPublisherTelephone("G");
publisherVersionView.setPublisherEmail("H");
publisherVersionView.setPublisherURL("I");
publisherVersionView.setPublisherActive(true);
publisherVersionView.setPublisherHistory("J");
publisherVersionView.setPublisher(publisherMock);
}
......