branch develop updated (564cc54 -> 573de56)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository observe. See https://gitlab.nuiton.org/codelutin/observe.git from 564cc54 optimize dependencies (bis) new 7507619 changement des loggeurs new f2ef0f2 Ajouter l'heure dans les informations technique d'un référentiel new 799b1c4 Ajout d'un FIXME qu'il faudrait mieux gérer new e3e0875 Amélioration de gestion des associations dans les sql batch tables new 573de56 Correction de la suppression des données The 5 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 573de5613b40f1f55b18268d66516c6a9e2e30dc Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Aug 23 18:58:35 2016 +0200 Correction de la suppression des données commit e3e0875e0d69b273f14dd5d5dcd28c25d7a49561 Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Aug 23 18:58:23 2016 +0200 Amélioration de gestion des associations dans les sql batch tables commit 799b1c473ac19abb1597f02610c1882efe1626bc Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Aug 23 18:57:56 2016 +0200 Ajout d'un FIXME qu'il faudrait mieux gérer commit f2ef0f2331fc51337e2a128353e2ebbcbf7e5e61 Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Aug 23 18:57:33 2016 +0200 Ajouter l'heure dans les informations technique d'un référentiel commit 7507619158349321f3296057b6ee2909d35cf097 Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Aug 23 18:57:11 2016 +0200 changement des loggeurs Summary of changes: .../ui/content/ref/ContentReferenceUIHandler.java | 4 +- .../src/main/resources/log4j.properties | 2 +- .../src/main/resources/observe-log4j.properties | 1 + .../services/service/DataSourceServiceTopia.java | 6 +- .../sql/batch/actions/DeleteTablesAction.java | 13 +++- .../service/sql/batch/tables/TopiaSqlTable.java | 17 ++++- .../service/sql/batch/tables/TopiaSqlTables.java | 77 ++++++++++++++-------- 7 files changed, 87 insertions(+), 33 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository observe. See https://gitlab.nuiton.org/codelutin/observe.git commit 7507619158349321f3296057b6ee2909d35cf097 Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Aug 23 18:57:11 2016 +0200 changement des loggeurs --- observe-application-swing/src/main/resources/log4j.properties | 2 +- observe-application-swing/src/main/resources/observe-log4j.properties | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/observe-application-swing/src/main/resources/log4j.properties b/observe-application-swing/src/main/resources/log4j.properties index 28f9047..a1ddda9 100644 --- a/observe-application-swing/src/main/resources/log4j.properties +++ b/observe-application-swing/src/main/resources/log4j.properties @@ -49,7 +49,7 @@ log4j.logger.fr.ird.observe.ui.util.decorator=ERROR log4j.logger.org.nuiton.config=INFO log4j.logger.org.nuiton.topia.migration=INFO -#log4j.logger.org.nuiton.topia.replication=INFO +log4j.logger.org.nuiton.topia.service.sql=INFO log4j.logger.jaxx.runtime.validator.swing.SwingValidator=ERROR diff --git a/observe-application-swing/src/main/resources/observe-log4j.properties b/observe-application-swing/src/main/resources/observe-log4j.properties index 61ae1eb..e28ea1a 100644 --- a/observe-application-swing/src/main/resources/observe-log4j.properties +++ b/observe-application-swing/src/main/resources/observe-log4j.properties @@ -47,6 +47,7 @@ log4j.logger.fr.ird.observe.validation.field=WARN log4j.logger.fr.ird.observe.ui.tree=INFO log4j.logger.fr.ird.observe.ui.util.decorator=ERROR +log4j.logger.org.nuiton.topia.service.sql=INFO log4j.logger.org.nuiton.topia.migration=INFO log4j.logger.org.nuiton.config=INFO #log4j.logger.org.nuiton.topia.replication=INFO -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository observe. See https://gitlab.nuiton.org/codelutin/observe.git commit f2ef0f2331fc51337e2a128353e2ebbcbf7e5e61 Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Aug 23 18:57:33 2016 +0200 Ajouter l'heure dans les informations technique d'un référentiel --- .../java/fr/ird/observe/ui/content/ref/ContentReferenceUIHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/ref/ContentReferenceUIHandler.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/ref/ContentReferenceUIHandler.java index 7e0eacc..965c85b 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/ref/ContentReferenceUIHandler.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/ref/ContentReferenceUIHandler.java @@ -113,9 +113,9 @@ public class ContentReferenceUIHandler<E extends ReferentialDto> extends Content uiInitializer = new ReferentialContentUIInitializer<>(ui); Locale locale = ui.getConfig().getLocale(); if (Locale.ENGLISH.equals(locale)) { - dateFormat = FastDateFormat.getInstance("yyyy-MM-ddZZ"); + dateFormat = FastDateFormat.getInstance("yyyy-MM-ddZZ hh:mm:ss"); } else { - dateFormat = FastDateFormat.getInstance("dd/MM/yyyy"); + dateFormat = FastDateFormat.getInstance("dd/MM/yyyy hh:mm:ss"); } revalidate = () -> { -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository observe. See https://gitlab.nuiton.org/codelutin/observe.git commit 799b1c473ac19abb1597f02610c1882efe1626bc Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Aug 23 18:57:56 2016 +0200 Ajout d'un FIXME qu'il faudrait mieux gérer --- .../fr/ird/observe/services/service/DataSourceServiceTopia.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/observe-services-topia/src/main/java/fr/ird/observe/services/service/DataSourceServiceTopia.java b/observe-services-topia/src/main/java/fr/ird/observe/services/service/DataSourceServiceTopia.java index 46c08ce..39a989c 100644 --- a/observe-services-topia/src/main/java/fr/ird/observe/services/service/DataSourceServiceTopia.java +++ b/observe-services-topia/src/main/java/fr/ird/observe/services/service/DataSourceServiceTopia.java @@ -110,7 +110,11 @@ public class DataSourceServiceTopia extends ObserveServiceTopia implements DataS if (databaseLockFile.exists()) { String message = l(getApplicationLocale(), "observe.services.topia.error.h2.database.locked"); - throw new DatabaseConnexionNotAuthorizedException(message, dataSourceConfiguration); + if (log.isWarnEnabled()) { + log.warn(message); + } + // FIXME even if file is lock we still authorize to connect, + //throw new DatabaseConnexionNotAuthorizedException(message, dataSourceConfiguration); } // On tente une connection à la base -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository observe. See https://gitlab.nuiton.org/codelutin/observe.git commit e3e0875e0d69b273f14dd5d5dcd28c25d7a49561 Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Aug 23 18:58:23 2016 +0200 Amélioration de gestion des associations dans les sql batch tables --- .../service/sql/batch/tables/TopiaSqlTable.java | 17 ++++- .../service/sql/batch/tables/TopiaSqlTables.java | 77 ++++++++++++++-------- 2 files changed, 66 insertions(+), 28 deletions(-) diff --git a/observe-topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/tables/TopiaSqlTable.java b/observe-topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/tables/TopiaSqlTable.java index df4c94a..6b14739 100644 --- a/observe-topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/tables/TopiaSqlTable.java +++ b/observe-topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/tables/TopiaSqlTable.java @@ -46,6 +46,8 @@ public class TopiaSqlTable { * Table name. */ protected final String tableName; + private final boolean associationTable; + private final String joinColumnName; /** * Fully table name (including the schema name). @@ -71,13 +73,17 @@ public class TopiaSqlTable { String tableName, String fromClause, String whereClauseAlias, - ImmutableSet<String> joinClauses) { + ImmutableSet<String> joinClauses, + boolean associationTable, + String joinColumnName) { this.schemaName = schemaName.toLowerCase(); this.tableName = tableName.toLowerCase(); + this.associationTable = associationTable; this.fullyTableName = this.schemaName + "." + this.tableName; this.fromClause = fromClause; this.whereClauseAlias = whereClauseAlias; this.joinClauses = joinClauses; + this.joinColumnName = joinColumnName; } public String getSchemaName() { @@ -118,6 +124,14 @@ public class TopiaSqlTable { return joinClauses; } + public boolean isAssociationTable() { + return associationTable; + } + + public String getJoinColumnName() { + return joinColumnName; + } + @Override public boolean equals(Object o) { if (this == o) return true; @@ -135,6 +149,7 @@ public class TopiaSqlTable { public String toString() { return MoreObjects.toStringHelper(this) .add("fullyTableName", fullyTableName) + .add("associationTable", associationTable) .toString(); } } diff --git a/observe-topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/tables/TopiaSqlTables.java b/observe-topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/tables/TopiaSqlTables.java index 82f1a87..9cef9c7 100644 --- a/observe-topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/tables/TopiaSqlTables.java +++ b/observe-topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/tables/TopiaSqlTables.java @@ -27,6 +27,8 @@ import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.nuiton.topia.persistence.TopiaEntityEnum; import java.util.Collections; @@ -47,6 +49,9 @@ import java.util.TreeMap; */ public class TopiaSqlTables implements Iterable<TopiaSqlTable> { + /** Logger. */ + private static final Log log = LogFactory.getLog(TopiaSqlTables.class); + protected final ImmutableMap<String, TopiaSqlTable> tablesByFullyTableName; protected final ImmutableSet<TopiaSqlTable> orderedTables; @@ -76,14 +81,14 @@ public class TopiaSqlTables implements Iterable<TopiaSqlTable> { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("orderedTables", orderedTables) - .toString(); + .add("orderedTables", orderedTables) + .toString(); } public TopiaSqlTables reverse() { - List<TopiaSqlTable> reverseList = new LinkedList<>(); + List<TopiaSqlTable> reverseList = new LinkedList<>(); for (TopiaSqlTable orderedTable : orderedTables) { - reverseList.add(0,orderedTable); + reverseList.add(0, orderedTable); } ImmutableSet<TopiaSqlTable> reverseSet = ImmutableSet.copyOf(reverseList); @@ -151,11 +156,7 @@ public class TopiaSqlTables implements Iterable<TopiaSqlTable> { String whereClauseAlias = tableName + ".topiaid"; String fromClause = schemaName + "." + tableName + " " + tableName; - registerTable(schemaName, - tableName, - whereClauseAlias, - fromClause, - ImmutableSet.of()); + registerTable(schemaName, tableName, whereClauseAlias, fromClause, ImmutableSet.of()); return new BuilderStepOnTableImpl(null, entityEnum); } @@ -171,7 +172,7 @@ public class TopiaSqlTables implements Iterable<TopiaSqlTable> { } return new TopiaSqlTables(ImmutableMap.copyOf(tablesByFullyTableName), - orderedTablesBuilder.build()); + orderedTablesBuilder.build()); } protected Builder registerTable(String schemaName, @@ -179,6 +180,28 @@ public class TopiaSqlTables implements Iterable<TopiaSqlTable> { String whereClauseAlias, String fromClause, ImmutableSet<String> joinClauses) { + return registerTable(schemaName, tableName, whereClauseAlias, fromClause, joinClauses, false, null); + + } + + protected Builder registerAssociationTable(String schemaName, + String tableName, + String whereClauseAlias, + String fromClause, + ImmutableSet<String> joinClauses, + String joinColumnName) { + + return registerTable(schemaName, tableName, whereClauseAlias, fromClause, joinClauses, true, joinColumnName); + + } + + private Builder registerTable(String schemaName, + String tableName, + String whereClauseAlias, + String fromClause, + ImmutableSet<String> joinClauses, + boolean associationTable, + String joinColumnName) { //TODO check that this table is not already registred @@ -187,7 +210,13 @@ public class TopiaSqlTables implements Iterable<TopiaSqlTable> { tableName, fromClause, whereClauseAlias, - joinClauses); + joinClauses, + associationTable, + joinColumnName); + + if (log.isInfoEnabled()) { + log.info("new TopiaTable: " + table); + } tablesByFullyTableName.put(table.getFullyTableName(), table); tablesByOrder.put(internalOrder++, table); @@ -273,11 +302,7 @@ public class TopiaSqlTables implements Iterable<TopiaSqlTable> { } - registerTable(schemaName, - tableName, - whereClauseAlias, - fromClause, - joinClauses); + registerTable(schemaName, tableName, whereClauseAlias, fromClause, joinClauses); return this; } @@ -303,12 +328,7 @@ public class TopiaSqlTables implements Iterable<TopiaSqlTable> { ImmutableSet<String> joinClauses = addJoinCause(parentTable.getJoinClauses(), joinClause); - registerTable( - schemaName, - tableName, - whereClauseAlias, - fromClause, - joinClauses); + registerTable(schemaName, tableName, whereClauseAlias, fromClause, joinClauses); invertOrderWithParent(parentTable, entityEnum); return this; @@ -346,11 +366,14 @@ public class TopiaSqlTables implements Iterable<TopiaSqlTable> { joinClauses = parentTable.getJoinClauses(); } - registerTable(schemaName, - tableName, - whereClauseAlias, - fromClause, - joinClauses); + String joinColumnName = parentTable.getTableName(); + + registerAssociationTable(schemaName, + tableName, + whereClauseAlias, + fromClause, + joinClauses, + joinColumnName); return this; } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository observe. See https://gitlab.nuiton.org/codelutin/observe.git commit 573de5613b40f1f55b18268d66516c6a9e2e30dc Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Aug 23 18:58:35 2016 +0200 Correction de la suppression des données --- .../topia/service/sql/batch/actions/DeleteTablesAction.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/observe-topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/DeleteTablesAction.java b/observe-topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/DeleteTablesAction.java index ba71564..8b3397b 100644 --- a/observe-topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/DeleteTablesAction.java +++ b/observe-topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/DeleteTablesAction.java @@ -44,6 +44,8 @@ import java.util.List; */ public class DeleteTablesAction extends AbstractTablesAction<DeleteTablesRequest> { + public static final String DELETE_ASSOCIATION_STATEMENT = "DELETE FROM %s.%s WHERE %s = '%%s';\n"; + public static final String DELETE_STATEMENT = "DELETE FROM %s.%s WHERE topiaId = '%%s';\n"; /** * Logger. @@ -67,6 +69,10 @@ public class DeleteTablesAction extends AbstractTablesAction<DeleteTablesRequest String topiaIdColumnName = TopiaEntity.PROPERTY_TOPIA_ID.toLowerCase(); int topiaIdColumnIndex = columnNames.indexOf(topiaIdColumnName) + 1; + if (table.isAssociationTable()) { + topiaIdColumnIndex = 1; + } + boolean useOutputWriter = useOutputWriter(); boolean useOutputDb = useOutputDb(); @@ -132,7 +138,12 @@ public class DeleteTablesAction extends AbstractTablesAction<DeleteTablesRequest protected String newDeleteStatementSql(TopiaSqlTable table) { - String sql = String.format(DELETE_STATEMENT, table.getSchemaName(), table.getTableName()); + String sql; + if (table.isAssociationTable()) { + sql = String.format(DELETE_ASSOCIATION_STATEMENT, table.getSchemaName(), table.getTableName(), table.getJoinColumnName()); + } else { + sql = String.format(DELETE_STATEMENT, table.getSchemaName(), table.getTableName()); + } if (log.isDebugEnabled()) { log.debug("Delete sql: " + sql); } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm