Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: c1620875 by Tony Chemit at 2021-02-10T18:23:08+01:00 Problème sur la gestion des référentiels manquant lors d'un import - Closes #1784 - - - - - 1 changed file: - services/local-impl/src/main/java/fr/ird/observe/services/local/service/referential/ReferentialShellBuilder.java Changes: ===================================== services/local-impl/src/main/java/fr/ird/observe/services/local/service/referential/ReferentialShellBuilder.java ===================================== @@ -42,22 +42,6 @@ public class ReferentialShellBuilder { private final GetEntityReferentialShellVisitor visitor; - private ReferentialShellBuilder(ImmutableSetStringMap incomingReferentialIds) { - visitor = new GetEntityReferentialShellVisitor(incomingReferentialIds); - } - - public static ReferentialShellBuilder builder(ImmutableSetStringMap incomingReferentialIds) { - return new ReferentialShellBuilder(incomingReferentialIds); - } - - void scan(TopiaEntity entity) { - entity.accept(visitor); - } - - public ImmutableSetStringMap build() { - return visitor.missingReferentialIds.build(); - } - private static class GetEntityReferentialShellVisitor implements TopiaEntityVisitor { private final Set<String> hitIds; @@ -100,11 +84,11 @@ public class ReferentialShellBuilder { @Override public void visit(TopiaEntity entity, String propertyName, Class<?> collectionType, Class<?> type, Object value) { - if (TopiaEntity.class.isAssignableFrom(type)) - for (Object child : ((Collection<?>) value)) { - ((TopiaEntity) child).accept(this); + if (TopiaEntity.class.isAssignableFrom(type)) { + for (Object child : ((Collection<?>) value)) { + ((TopiaEntity) child).accept(this); + } } - } @Override @@ -120,4 +104,20 @@ public class ReferentialShellBuilder { } } + public static ReferentialShellBuilder builder(ImmutableSetStringMap incomingReferentialIds) { + return new ReferentialShellBuilder(incomingReferentialIds); + } + + private ReferentialShellBuilder(ImmutableSetStringMap incomingReferentialIds) { + visitor = new GetEntityReferentialShellVisitor(incomingReferentialIds); + } + + void scan(TopiaEntity entity) { + entity.accept(visitor); + } + + public ImmutableSetStringMap build() { + return visitor.missingReferentialIds.build(); + } + } View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/c1620875650a55fab1e9ba07e7... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/c1620875650a55fab1e9ba07e7... You're receiving this email because of your account on gitlab.com.
participants (1)
-
Tony CHEMIT