This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository echobase. See https://gitlab.nuiton.org/codelutin/echobase.git commit 6dccdf9e07b9b3a2f9cd0548dc8ca0fa81f566b0 Author: Eric Chatellier <chatellier@codelutin.com> Date: Thu Mar 10 17:31:03 2016 +0100 fixes #8089: Migrate to ToPIA 3.0 --- .../java/fr/ifremer/echobase/FixedH2Dialect.java | 48 ++++++++++++++++++++++ .../fr/ifremer/echobase/entities/DriverType.java | 4 +- .../main/resources/echobase-internaldb.properties | 2 +- .../src/main/xmi/echobase-internal.properties | 1 + echobase-domain/src/main/xmi/echobase.properties | 1 + 5 files changed, 53 insertions(+), 3 deletions(-) diff --git a/echobase-domain/src/main/java/fr/ifremer/echobase/FixedH2Dialect.java b/echobase-domain/src/main/java/fr/ifremer/echobase/FixedH2Dialect.java new file mode 100644 index 0000000..a63db5b --- /dev/null +++ b/echobase-domain/src/main/java/fr/ifremer/echobase/FixedH2Dialect.java @@ -0,0 +1,48 @@ +/* + * #%L + * EchoBase :: Domain + * %% + * Copyright (C) 2016 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase; + +import java.sql.Types; + +import org.hibernate.dialect.H2Dialect; + +/** + * Override the H2Dialect to fix detected wrong value. + * + * org.nuiton.topia.persistence.SchemaValidationTopiaException: + * Wrong column type in ECHOBASE.PUBLIC.ENTITYMODIFICATIONLOG for column modificationText. Found: varchar, expected: longvarchar + * + * org.nuiton.topia.persistence.SchemaValidationTopiaException: + * Wrong column type in ECHOBASE.PUBLIC.ACOUSTICINSTRUMENT for column transducerDepth. Found: double, expected: float + * + * org.nuiton.topia.persistence.SchemaValidationTopiaException: + * Wrong column type in ECHOBASE.PUBLIC.IMPORTFILE for column topiaCreateDate. Found: date, expected: timestamp + */ +public class FixedH2Dialect extends H2Dialect { + + public FixedH2Dialect() { + registerColumnType( Types.LONGVARCHAR, String.format("varchar(%d)", Integer.MAX_VALUE) ); + registerColumnType( Types.FLOAT, "double" ); + registerColumnType( Types.TIMESTAMP, "date" ); + } + +} + diff --git a/echobase-domain/src/main/java/fr/ifremer/echobase/entities/DriverType.java b/echobase-domain/src/main/java/fr/ifremer/echobase/entities/DriverType.java index e9b8b4f..5f4a66b 100644 --- a/echobase-domain/src/main/java/fr/ifremer/echobase/entities/DriverType.java +++ b/echobase-domain/src/main/java/fr/ifremer/echobase/entities/DriverType.java @@ -2,9 +2,9 @@ package fr.ifremer.echobase.entities; import static org.nuiton.i18n.I18n.n; -import org.hibernate.dialect.H2Dialect; import org.hibernate.dialect.PostgreSQL82Dialect; +import fr.ifremer.echobase.FixedH2Dialect; import fr.ifremer.echobase.I18nAble; /* @@ -39,7 +39,7 @@ import fr.ifremer.echobase.config.EchoBaseConfiguration; public enum DriverType implements I18nAble { H2(org.h2.Driver.class, - H2Dialect.class, + FixedH2Dialect.class, n("echobase.common.driverType.h2")) { @Override public String getPilotVersion(EchoBaseConfiguration config) { diff --git a/echobase-domain/src/main/resources/echobase-internaldb.properties b/echobase-domain/src/main/resources/echobase-internaldb.properties index a48c96e..b37b294 100644 --- a/echobase-domain/src/main/resources/echobase-internaldb.properties +++ b/echobase-domain/src/main/resources/echobase-internaldb.properties @@ -20,7 +20,7 @@ ### # Database basic configuration -hibernate.dialect=org.hibernate.dialect.H2Dialect +hibernate.dialect=fr.ifremer.echobase.FixedH2Dialect hibernate.connection.provider_class=org.nuiton.topia.persistence.internal.TopiaConnectionProvider hibernate.connection.username=sa hibernate.connection.password=sa diff --git a/echobase-domain/src/main/xmi/echobase-internal.properties b/echobase-domain/src/main/xmi/echobase-internal.properties index 674f637..0de1f75 100644 --- a/echobase-domain/src/main/xmi/echobase-internal.properties +++ b/echobase-domain/src/main/xmi/echobase-internal.properties @@ -26,6 +26,7 @@ model.tagValue.version=2.2 model.tagValue.noPCS=true model.tagValue.doNotGenerateBooleanGetMethods=true model.tagValue.indexForeignKeys=true +model.tagValue.useEnumerationName=false ############################################################################### ### Ordered attributes ######################################################## diff --git a/echobase-domain/src/main/xmi/echobase.properties b/echobase-domain/src/main/xmi/echobase.properties index d69f770..15cb7b6 100644 --- a/echobase-domain/src/main/xmi/echobase.properties +++ b/echobase-domain/src/main/xmi/echobase.properties @@ -27,6 +27,7 @@ model.tagValue.noPCS=true model.tagValue.doNotGenerateBooleanGetMethods=true model.tagValue.indexForeignKeys=true model.tagValue.daoSuperClass=fr.ifremer.echobase.entities.AbstractEchoBaseDao +model.tagValue.useEnumerationName=false ############################################################################### ### Ordered attributes ######################################################## -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.