Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
-
75d64c9f
by Tony Chemit at 2022-03-12T09:56:41+01:00
2 changed files:
- common-dto/src/main/java/fr/ird/observe/dto/IdHelper.java
- services-local/src/main/java/fr/ird/observe/services/local/service/referential/ReferentialServiceLocal.java
Changes:
| ... | ... | @@ -77,6 +77,10 @@ public class IdHelper { |
| 77 | 77 | return DTO_REFERENTIAL_LONGLINE_PACKAGE.startsWith(packageName);
|
| 78 | 78 | }
|
| 79 | 79 | |
| 80 | + public static boolean isEntityData(Class<?> type) {
|
|
| 81 | + return type.getPackage().getName().startsWith(ENTITY_DATA_PACKAGE);
|
|
| 82 | + }
|
|
| 83 | + |
|
| 80 | 84 | public static boolean isData(Class type) {
|
| 81 | 85 | return isDataFromPackageName(type.getPackage().getName());
|
| 82 | 86 | }
|
| ... | ... | @@ -95,7 +95,6 @@ import java.util.Objects; |
| 95 | 95 | import java.util.Optional;
|
| 96 | 96 | import java.util.Set;
|
| 97 | 97 | import java.util.function.Predicate;
|
| 98 | -import java.util.stream.Collector;
|
|
| 99 | 98 | import java.util.stream.Collectors;
|
| 100 | 99 | |
| 101 | 100 | /**
|
| ... | ... | @@ -268,7 +267,7 @@ public class ReferentialServiceLocal extends ObserveServiceLocal implements Refe |
| 268 | 267 | ObserveReferentialEntity entity = loadEntity(spi.toDtoType(), bean.getId());
|
| 269 | 268 | |
| 270 | 269 | Map<Class<? extends TopiaEntity>, List<? extends TopiaEntity>> compositions = serviceContext.getTopiaApplicationContext().findReverseCompositions(getTopiaPersistenceContext(), entity, e -> true);
|
| 271 | - Map<Class<? extends TopiaEntity>, List<? extends TopiaEntity>> associations = serviceContext.getTopiaApplicationContext().findReverseAssociations(getTopiaPersistenceContext(), entity, IdHelper::isData);
|
|
| 270 | + Map<Class<? extends TopiaEntity>, List<? extends TopiaEntity>> associations = serviceContext.getTopiaApplicationContext().findReverseAssociations(getTopiaPersistenceContext(), entity, IdHelper::isEntityData);
|
|
| 272 | 271 | |
| 273 | 272 | ImmutableSetDtoMap.Builder<DtoReference> result = ImmutableSetDtoMap.builder();
|
| 274 | 273 |