Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: ad0dd0ec by Tony Chemit at 2022-11-11T15:20:51+01:00 [UI REFERENTIELS] Envisager un auto-trim droite et gauche sur les champs alphanumériques - See #1544 - - - - - 5 changed files: - core/persistence/resources/src/main/java/fr/ird/observe/spi/migration/v9/DataSourceMigrationForVersion_9_0.java - core/persistence/resources/src/main/java/fr/ird/observe/spi/migration/v9/DiscardedTargetCatchRecord.java - + core/persistence/resources/src/main/java/fr/ird/observe/spi/migration/v9/FixCommentHelper.java - + core/persistence/resources/src/main/java/fr/ird/observe/spi/migration/v9/FixStringHelper.java - core/persistence/resources/src/main/java/fr/ird/observe/spi/migration/v9/NotDiscardedTargetCatchRecord.java Changes: ===================================== core/persistence/resources/src/main/java/fr/ird/observe/spi/migration/v9/DataSourceMigrationForVersion_9_0.java ===================================== @@ -254,6 +254,7 @@ public class DataSourceMigrationForVersion_9_0 extends ByMajorMigrationVersionRe executor.addScript("96", "add_referential_ps_common_ObservedSystem_finalize"); } } + private void migrateCatches(MigrationVersionResourceExecutor executor) { Function<String, String> commentFormat = executor.commentFormat(); @@ -589,6 +590,14 @@ public class DataSourceMigrationForVersion_9_0 extends ByMajorMigrationVersionRe @Override public void generateFinalizeSqlScript(MigrationVersionResourceExecutor executor) { + long stringFixedCount = new FixStringHelper(executor).execute(); + if (stringFixedCount > 0) { + log.warn(String.format("Fix %s string rows(s).", stringFixedCount)); + } + long commentFixedCount = new FixCommentHelper(executor).execute(); + if (commentFixedCount > 0) { + log.warn(String.format("Fix %s comment rows(s).", commentFixedCount)); + } migrateIdx(executor, "ps_observation", "catch", "set"); migrateIdx(executor, "ps_observation", "SampleMeasure", "sample"); } ===================================== core/persistence/resources/src/main/java/fr/ird/observe/spi/migration/v9/DiscardedTargetCatchRecord.java ===================================== @@ -56,19 +56,19 @@ public class DiscardedTargetCatchRecord { public static PreparedStatement prepareStatement(Connection connection) throws SQLException { return connection.prepareStatement("SELECT" + - /* 01 */ " REPLACE(tc.topiaId, '.TargetCatch', '.Catch')," + - /* 02 */ " tc.topiaVersion + 1," + - /* 03 */ " tc.topiaCreateDate," + - /* 04 */ " tc.homeId," + - /* 05 */ " tc.catchWeight," + - /* 06 */ " tc.weightCategory," + - /* 07 */ " tc.comment," + - /* 08 */ " tc.reasonForDiscard," + - /* 09 */ " tc.set," + - /* 10 */ " tc.lastUpdateDate," + - /* 11 */ " tc.well," + - /* 12 */ " -tc.set_idx," + - /* 13 */ " tc.weightMeasureMethod" + + /* 01 */ " REPLACE(tc.topiaId, '.TargetCatch', '.Catch')," + + /* 02 */ " tc.topiaVersion + 1," + + /* 03 */ " tc.topiaCreateDate," + + /* 04 */ " tc.homeId," + + /* 05 */ " tc.catchWeight," + + /* 06 */ " tc.weightCategory," + + /* 07 */ " tc.comment," + + /* 08 */ " tc.reasonForDiscard," + + /* 09 */ " tc.set," + + /* 10 */ " tc.lastUpdateDate," + + /* 11 */ " tc.well," + + /* 12 */ " -tc.set_idx," + + /* 13 */ " tc.weightMeasureMethod" + " FROM ps_observation.TargetCatch tc" + " WHERE tc.discarded"); } @@ -135,7 +135,7 @@ public class DiscardedTargetCatchRecord { /*1*/ DataDtoEntityContext.escapeString(id), /*2*/ topiaVersion, /*3*/ DataDtoEntityContext.timestamp(topiaCreateDate), - /*4*/ DataDtoEntityContext.escapeString(homeId), + /*4*/ DataDtoEntityContext.escapeString(FixStringHelper.cleanString(homeId, true)), /*5*/ catchWeight, /*6*/ weightCategoryRecord.getMinWeight(), /*7*/ weightCategoryRecord.getMaxWeight(), @@ -146,7 +146,7 @@ public class DiscardedTargetCatchRecord { /*12*/ DataDtoEntityContext.escapeString(DataSourceMigrationForVersion_9_0.SPECIES_FATE_5), /*13*/ DataDtoEntityContext.escapeString(setId), /*14*/ DataDtoEntityContext.timestamp(lastUpdateDate), - /*15*/ DataDtoEntityContext.escapeString(getWell()), + /*15*/ DataDtoEntityContext.escapeString(FixStringHelper.cleanString(well, true)), /*16*/ setIdx, /*17*/ DataDtoEntityContext.escapeString(weightMeasureMethodId == null ? "fr.ird.referential.common.WeightMeasureMethod#666#03" : weightCategoryId), /*18*/ DataDtoEntityContext.escapeString(DataSourceMigrationForVersion_9_0.INFORMATION_SOURCE_O) @@ -160,14 +160,4 @@ public class DiscardedTargetCatchRecord { return stringFormat.apply(comment + "\n" + weightCategoryRecord.toComment()); } - public String getWell() { - String result = well; - if (result!=null) { - result = well.trim(); - if (well.startsWith("'")) { - result = result.substring(1); - } - } - return result; - } } ===================================== core/persistence/resources/src/main/java/fr/ird/observe/spi/migration/v9/FixCommentHelper.java ===================================== @@ -0,0 +1,133 @@ +package fr.ird.observe.spi.migration.v9; + +/*- + * #%L + * ObServe Core :: Persistence :: Resources + * %% + * Copyright (C) 2008 - 2022 IRD, Ultreia.io + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU 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 General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.nuiton.topia.service.migration.resources.MigrationVersionResourceExecutor; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.util.Objects; +import java.util.concurrent.atomic.AtomicLong; +import java.util.function.Function; + +/** + * To auto-trim string comment fields. + * <p> + * <strong>Note:</strong> If fixed value is empty or blank then set {@code null} value. + * <p> + * Created on 11/11/2022. + * + * @author Tony Chemit - dev@tchemit.fr + * @since 9.0.17 + */ +public class FixCommentHelper { + + private static final Logger log = LogManager.getLogger(FixCommentHelper.class); + + private final MigrationVersionResourceExecutor executor; + private final AtomicLong count = new AtomicLong(); + private final Function<String, String> commentFormat; + + public FixCommentHelper(MigrationVersionResourceExecutor executor) { + this.executor = Objects.requireNonNull(executor); + commentFormat = executor.commentFormat(); + } + + public long execute() { + + fixField("common.Vessel", "comment"); + + fixField("ll_common.GearUseFeatures", "comment"); + fixField("ll_common.Program", "comment"); + fixField("ll_common.Trip", "generalComment"); + fixField("ll_common.Trip", "logbookComment"); + fixField("ll_common.Trip", "observationsComment"); + + fixField("ll_landing.Landing", "comment"); + + fixField("ll_logbook.Activity", "comment"); + fixField("ll_logbook.Catch", "comment"); + fixField("ll_logbook.Set", "comment"); + fixField("ll_logbook.Sample", "comment"); + + fixField("ll_observation.Activity", "comment"); + fixField("ll_observation.Branchline", "comment"); + fixField("ll_observation.Catch", "comment"); + fixField("ll_observation.Set", "comment"); + + fixField("ps_common.GearUseFeatures", "comment"); + fixField("ps_common.Program", "comment"); + fixField("ps_common.Trip", "generalComment"); + fixField("ps_common.Trip", "logbookComment"); + fixField("ps_common.Trip", "observationsComment"); + + fixField("ps_localmarket.Batch", "origin"); + fixField("ps_localmarket.Sample", "comment"); + fixField("ps_localmarket.SampleSpecies", "comment"); + fixField("ps_localmarket.Survey", "comment"); + + fixField("ps_logbook.Activity", "comment"); + fixField("ps_logbook.Catch", "comment"); + fixField("ps_logbook.FloatingObject", "comment"); + fixField("ps_logbook.Route", "comment"); + fixField("ps_logbook.Sample", "comment"); + fixField("ps_logbook.SampleSpecies", "comment"); + fixField("ps_logbook.TransmittingBuoy", "comment"); + + fixField("ps_observation.Activity", "comment"); + fixField("ps_observation.Catch", "comment"); + fixField("ps_observation.FloatingObject", "comment"); + fixField("ps_observation.NonTargetCatchRelease", "comment"); + fixField("ps_observation.Route", "comment"); + fixField("ps_observation.Set", "comment"); + fixField("ps_observation.TransmittingBuoy", "comment"); + return count.get(); + } + + public void fixField(String gav, String field) { + + executor.doSqlWork(connection -> { + try (PreparedStatement statement = connection.prepareStatement(String.format("SELECT topiaId, %2$s FROM %1$s WHERE %2$s IS NOT NULL", gav, field))) { + try (ResultSet resultSet = statement.executeQuery()) { + while (resultSet.next()) { + String fieldValue = resultSet.getString(2); + String fixFieldValue = fieldValue.trim(); + if (!fieldValue.equals(fixFieldValue)) { + if (fixFieldValue.isEmpty()) { + fixFieldValue = null; + } + String id = resultSet.getString(1); + String finalFieldValue = commentFormat.apply(fixFieldValue); + log.warn(String.format("Fix comment field %s.%s[%s] (from '%s' to %s)", gav, field, id, fieldValue, finalFieldValue)); + executor.writeSql(String.format("UPDATE %s SET %s = %s WHERE topiaId = '%s';", gav, field, finalFieldValue, id)); + count.incrementAndGet(); + } + } + } + } + }); + + } +} ===================================== core/persistence/resources/src/main/java/fr/ird/observe/spi/migration/v9/FixStringHelper.java ===================================== @@ -0,0 +1,241 @@ +package fr.ird.observe.spi.migration.v9; + +/*- + * #%L + * ObServe Core :: Persistence :: Resources + * %% + * Copyright (C) 2008 - 2022 IRD, Ultreia.io + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU 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 General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import fr.ird.observe.spi.context.DataDtoEntityContext; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.nuiton.topia.service.migration.resources.MigrationVersionResourceExecutor; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.util.Objects; +import java.util.concurrent.atomic.AtomicLong; + +/** + * To auto-trim string fields and remove any {@code '} characters inside it. + * <p> + * <strong>Note:</strong> If fixed value is empty or blank then set {@code null} value. + * <p> + * Created on 11/11/2022. + * + * @author Tony Chemit - dev@tchemit.fr + * @since 9.0.17 + */ +public class FixStringHelper { + + private static final Logger log = LogManager.getLogger(FixStringHelper.class); + + private final MigrationVersionResourceExecutor executor; + private final AtomicLong count = new AtomicLong(); + + public FixStringHelper(MigrationVersionResourceExecutor executor) { + this.executor = Objects.requireNonNull(executor); + } + + public long execute() { + + fixI18nFields("common.Country", "code", "iso2Code", "iso3Code"); + fixI18nFields("common.DataQuality", "code"); + fixI18nFields("common.FpaZone", "code"); + fixI18nFields("common.Gear", "code"); + fixI18nFields("common.GearCharacteristic", "code"); + fixI18nFields("common.GearCharacteristicType", "code"); + fixI18nFields("common.Harbour", "code"); + fixFields("common.LengthLengthParameter", "coefficients", "inputOutputFormula", "outputInputFormula"); + fixI18nFields("common.LengthMeasureMethod", "code"); + fixFields("common.LengthWeightParameter", "coefficients", "lengthWeightFormula", "weightLengthFormula"); + fixI18nFields("common.Ocean", "code"); + fixI18nFields("common.Organism", "code"); + fixField("common.Person", "firstName", false); + fixField("common.Person", "firstName", false); + fixI18nFields("common.Sex", "code"); + fixFields("common.ShipOwner", "code", "label"); + fixI18nFields("common.SizeMeasureType", "code"); + fixI18nFields("common.Species", "scientificLabel"); + fixI18nFields("common.SpeciesGroup", "code"); + fixI18nFields("common.SpeciesGroupReleaseMode", "code"); + fixI18nFields("common.SpeciesList", "code"); + fixI18nFields("common.Vessel", "code"); + fixI18nFields("common.VesselType", "code"); + fixFields("common.VesselSizeCategory", "code", "capacityLabel", "gaugeLabel"); + fixI18nFields("common.WeightMeasureMethod", "code"); + fixI18nFields("common.WeightMeasureType", "code"); + fixI18nFields("common.Wind", "code"); + + fixI18nFields("ll_common.BaitSettingStatus", "code"); + fixI18nFields("ll_common.BaitType", "code"); + fixI18nFields("ll_common.CatchFate", "code"); + fixI18nFields("ll_common.HealthStatus", "code"); + fixI18nFields("ll_common.HookSize", "code"); + fixI18nFields("ll_common.HookType", "code"); + fixI18nFields("ll_common.LightsticksColor", "code"); + fixI18nFields("ll_common.LightsticksType", "code"); + fixI18nFields("ll_common.LineType", "code"); + fixI18nFields("ll_common.MitigationType", "code"); + fixI18nFields("ll_common.ObservationMethod", "code"); + fixI18nFields("ll_common.OnBoardProcessing", "code"); + fixI18nFields("ll_common.Program", "code"); + fixI18nFields("ll_common.SettingShape", "code"); + fixI18nFields("ll_common.TripType", "code"); + fixI18nFields("ll_common.VesselActivity", "code"); + fixI18nFields("ll_common.WeightDeterminationMethod", "code"); + + fixI18nFields("ll_landing.Company", "code"); + fixI18nFields("ll_landing.Conservation", "code"); + fixI18nFields("ll_landing.DataSource", "code"); + + fixI18nFields("ll_observation.BaitHaulingStatus", "code"); + fixI18nFields("ll_observation.EncounterType", "code"); + fixI18nFields("ll_observation.HookPosition", "code"); + fixI18nFields("ll_observation.ItemHorizontalPosition", "code"); + fixI18nFields("ll_observation.ItemVerticalPosition", "code"); + fixI18nFields("ll_observation.MaturityStatus", "code"); + fixFields("ll_observation.SensorBrand", "brandName", "code"); + fixI18nFields("ll_observation.SensorDataFormat", "code"); + fixI18nFields("ll_observation.SensorType", "code"); + fixI18nFields("ll_observation.StomachFullness", "code"); + + fixI18nFields("ps_common.AcquisitionStatus", "code"); + fixI18nFields("ps_common.ObjectMaterial", "code"); + fixI18nFields("ps_common.ObjectMaterialType", "code"); + fixI18nFields("ps_common.ObjectOperation", "code"); + fixI18nFields("ps_common.ObservedSystem", "code"); + fixI18nFields("ps_common.Program", "code"); + fixI18nFields("ps_common.ReasonForNoFishing", "code"); + fixI18nFields("ps_common.ReasonForNullSet", "code"); + fixI18nFields("ps_common.SampleType", "code"); + fixI18nFields("ps_common.SchoolType", "code"); + fixI18nFields("ps_common.SpeciesFate", "code"); + fixI18nFields("ps_common.TransmittingBuoyOperation", "code"); + fixI18nFields("ps_common.TransmittingBuoyOwnership", "code"); + fixI18nFields("ps_common.TransmittingBuoyType", "code"); + fixI18nFields("ps_common.VesselActivity", "code"); + fixI18nFields("ps_common.WeightCategory", "code"); + + fixI18nFields("ps_landing.Destination", "code"); + fixI18nFields("ps_landing.Fate", "code"); + + fixI18nFields("ps_localmarket.BatchComposition", "code"); + fixI18nFields("ps_localmarket.BatchWeightType", "code"); + fixI18nFields("ps_localmarket.Packaging", "code"); + + fixI18nFields("ps_logbook.InformationSource", "code"); + fixI18nFields("ps_logbook.SampleQuality", "code"); + fixI18nFields("ps_logbook.SetSuccessStatus", "code"); + fixI18nFields("ps_logbook.WellContentStatus", "code"); + fixI18nFields("ps_logbook.WellSamplingConformity", "code"); + fixI18nFields("ps_logbook.WellSamplingStatus", "code"); + + fixI18nFields("ps_observation.DetectionMode", "code"); + fixI18nFields("ps_observation.InformationSource", "code"); + fixI18nFields("ps_observation.NonTargetCatchReleaseConformity", "code"); + fixI18nFields("ps_observation.NonTargetCatchReleaseStatus", "code"); + fixI18nFields("ps_observation.NonTargetCatchReleasingTime", "code"); + fixI18nFields("ps_observation.ReasonForDiscard", "code"); + fixI18nFields("ps_observation.SpeciesStatus", "code"); + fixI18nFields("ps_observation.SurroundingActivity", "code"); + + fixFields("ll_common.GearUseFeaturesMeasurement", "measurementValue"); + fixFields("ll_common.Trip", "ersId", "homeId"); + + fixFields("ll_logbook.Catch", "photoReferences", "tagNumber"); + fixFields("ll_logbook.SamplePart", "tagNumber"); + fixFields("ll_logbook.Set", "homeId"); + + fixFields("ll_observation.Catch", "photoReferences", "tagNumber"); + fixFields("ll_observation.SensorUsed", "sensorSerialNo"); + fixFields("ll_observation.Set", "homeId"); + fixFields("ll_observation.Tdr", "serialNo"); + + fixFields("ps_common.GearUseFeaturesMeasurement", "measurementValue"); + fixFields("ps_common.Trip", "ersId", "formsUrl", "homeId", "reportsUrl"); + + fixFields("ps_localmarket.Sample", "number"); + + fixFields("ps_logbook.Catch", "well"); + fixFields("ps_logbook.FloatingObject", "supportVesselName"); + fixFields("ps_logbook.Sample", "well"); + fixFields("ps_logbook.TransmittingBuoy", "code"); + fixFields("ps_logbook.WellPlan", "well"); + + fixFields("ps_observation.Activity", "ersId"); + fixFields("ps_observation.FloatingObject", "supportVesselName"); + + fixFields("ps_observation.SampleMeasure", "picturesReferences", "tagNumber"); + fixFields("ps_observation.Set", "supportVesselName"); + fixFields("ps_observation.TransmittingBuoy", "code"); + return count.get(); + } + + public void fixI18nFields(String gav, String... extraFields) { + fixField(gav, "label1", false); + fixField(gav, "label2", false); + fixField(gav, "label3", false); + fixFields(gav, extraFields); + } + + public void fixFields(String gav, String... extraFields) { + for (String extraField : extraFields) { + fixField(gav, extraField, false); + } + } + + public void fixField(String gav, String field, boolean removeSimpleQuote) { + executor.doSqlWork(connection -> { + try (PreparedStatement statement = connection.prepareStatement(String.format("SELECT topiaId, %2$s FROM %1$s WHERE %2$s IS NOT NULL", gav, field))) { + try (ResultSet resultSet = statement.executeQuery()) { + while (resultSet.next()) { + String fieldValue = resultSet.getString(2); + String fixFieldValue = cleanString(fieldValue, removeSimpleQuote); + if (gav.equals("ps_common.ObjectMaterial") && field.equals("code") && fixFieldValue == null) { + // special case when we need to keep blank value + fixFieldValue = ""; + } + if (!fieldValue.equals(fixFieldValue)) { + String finalFieldValue = DataDtoEntityContext.escapeString(removeSimpleQuote ? fixFieldValue : fixFieldValue.replaceAll("'", "''")); + String id = resultSet.getString(1); + log.warn(String.format("Fix string field %s.%s[%s] (from '%s' to %s)", gav, field, id, fieldValue, finalFieldValue)); + executor.writeSql(String.format("UPDATE %1$s SET %2$s = %3$s WHERE topiaId = '%4$s';", gav, field, finalFieldValue, id)); + count.incrementAndGet(); + } + } + } + } + }); + } + + protected static String cleanString(String field, boolean removeSimpleQuote) { + String result = field; + if (result != null) { + result = result.trim(); + if (removeSimpleQuote) { + result = result.replaceAll("'", ""); + } + if (result.isEmpty()) { + result = null; + } + } + return result; + } +} ===================================== core/persistence/resources/src/main/java/fr/ird/observe/spi/migration/v9/NotDiscardedTargetCatchRecord.java ===================================== @@ -42,19 +42,19 @@ class NotDiscardedTargetCatchRecord { public static PreparedStatement prepareStatement(Connection connection) throws SQLException { return connection.prepareStatement("SELECT" + - /* 01 */ " REPLACE(tc.topiaId, '.TargetCatch', '.Catch')," + - /* 02 */ " tc.topiaVersion + 1," + - /* 03 */ " tc.topiaCreateDate," + - /* 04 */ " tc.homeId," + - /* 05 */ " tc.catchWeight," + - /* 06 */ " tc.weightCategory," + - /* 07 */ " tc.comment," + - /* 08 */ " tc.set," + - /* 09 */ " tc.lastUpdateDate," + - /* 10 */ " tc.well," + - /* 11 */ " -tc.set_idx," + - /* 12 */ " tc.weightMeasureMethod," + - /* 13 */ " s.targetcatchcompositionestimatedbyobserver " + + /* 01 */ " REPLACE(tc.topiaId, '.TargetCatch', '.Catch')," + + /* 02 */ " tc.topiaVersion + 1," + + /* 03 */ " tc.topiaCreateDate," + + /* 04 */ " tc.homeId," + + /* 05 */ " tc.catchWeight," + + /* 06 */ " tc.weightCategory," + + /* 07 */ " tc.comment," + + /* 08 */ " tc.set," + + /* 09 */ " tc.lastUpdateDate," + + /* 10 */ " tc.well," + + /* 11 */ " -tc.set_idx," + + /* 12 */ " tc.weightMeasureMethod," + + /* 13 */ " s.targetcatchcompositionestimatedbyobserver " + " FROM ps_observation.TargetCatch tc INNER JOIN ps_observation.set s on s.topiaId = tc.set" + " WHERE NOT tc.discarded AND NOT ( weightCategory IS NULL AND catchweight IS NULL AND well IS NULL AND broughtondeck IS NULL AND reasonfordiscard IS NULL )"); } @@ -134,7 +134,7 @@ class NotDiscardedTargetCatchRecord { /*1*/ DataDtoEntityContext.escapeString(id), /*2*/ topiaVersion, /*3*/ DataDtoEntityContext.timestamp(topiaCreateDate), - /*4*/ DataDtoEntityContext.escapeString(homeId), + /*4*/ DataDtoEntityContext.escapeString(FixStringHelper.cleanString(homeId, true)), /*5*/ catchWeight, /*6*/ weightCategoryRecord.getMinWeight(), /*7*/ weightCategoryRecord.getMaxWeight(), @@ -145,7 +145,7 @@ class NotDiscardedTargetCatchRecord { /*12*/ DataDtoEntityContext.escapeString("10".equals(weightCategoryRecord.getCode()) ? DataSourceMigrationForVersion_9_0.SPECIES_FATE_15 : DataSourceMigrationForVersion_9_0.SPECIES_FATE_6), /*13*/ DataDtoEntityContext.escapeString(setId), /*14*/ DataDtoEntityContext.timestamp(lastUpdateDate), - /*15*/ DataDtoEntityContext.escapeString(getWell()), + /*15*/ DataDtoEntityContext.escapeString(FixStringHelper.cleanString(well, true)), /*16*/ setIdx, /*17*/ DataDtoEntityContext.escapeString(weightMeasureMethodId == null ? "fr.ird.referential.common.WeightMeasureMethod#666#03" : weightCategoryId), /*18*/ DataDtoEntityContext.escapeString(targetCatchCompositionEstimatedByObserver ? DataSourceMigrationForVersion_9_0.INFORMATION_SOURCE_P : DataSourceMigrationForVersion_9_0.INFORMATION_SOURCE_U) @@ -158,16 +158,4 @@ class NotDiscardedTargetCatchRecord { } return stringFormat.apply(comment + "\n" + weightCategoryRecord.toComment()); } - - - public String getWell() { - String result = well; - if (result!=null) { - result = well.trim(); - if (well.startsWith("'")) { - result = result.substring(1); - } - } - return result; - } } View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/ad0dd0ec7e1a4b1c31e84a5656... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/ad0dd0ec7e1a4b1c31e84a5656... You're receiving this email because of your account on gitlab.com.
participants (1)
-
Tony CHEMIT (@tchemit)