Repository navigation
Conversation
Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
…t-network-applicabilities Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
…work Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
| SELECT m, :tag, CASE WHEN EXISTS (SELECT 1 FROM ModificationRootNetworkApplicabilityEntity a | ||
| WHERE a.modification = m AND a.applicable = false) THEN false ELSE true END | ||
| FROM ModificationEntity m | ||
| WHERE m.id IN (:ids) AND TYPE(m) <> ModificationReferenceEntity |
There was a problem hiding this comment.
All modification UUIDs go into a single IN (:ids) ?
we don't have sql limit here otherwise it will be rejected by sql? maybe we could filter by groupuuid ?
@etiennehomer what do you think ?
There was a problem hiding this comment.
With postgres, the limit is 65 535 parameters in IN clause. Should be ok
| AND NOT EXISTS (SELECT 1 FROM ModificationRootNetworkApplicabilityEntity a | ||
| WHERE a.modification = m AND a.rootNetworkTag = :tag) | ||
| """) | ||
| void addRootNetworkApplicabilityIfMissing(@Param("ids") Collection<UUID> ids, @Param("tag") String tag); |
There was a problem hiding this comment.
it is too complicated query, it should be reviewed by @etiennehomer or @SlimaneAmar
There was a problem hiding this comment.
To me, we should avoid as much as we can to put intelligence in the SQL. Most of the complexity should be done in java with understandable code.
If an optimization is needed, it should only be an INSERT with a list of modification uuids and a list of applicabilities
Same as https://github.com/gridsuite/network-modification-server/pull/932/changes#r4324384990
There was a problem hiding this comment.
Yes I will remove it
| @Query(""" | ||
| INSERT INTO ModificationRootNetworkApplicabilityEntity (modification, rootNetworkTag, applicable) | ||
| SELECT m, :tag, CASE WHEN EXISTS (SELECT 1 FROM ModificationRootNetworkApplicabilityEntity a | ||
| WHERE a.modification = m AND a.applicable = false) THEN false ELSE true END |
There was a problem hiding this comment.
including tags that are not in the study anymore ?
There was a problem hiding this comment.
Yes, whatever the study
| if (ownedUuids.isEmpty()) { | ||
| return; | ||
| } | ||
| Set<UUID> sharedModificationTreesUuids = getSharedModificationTrees(ownedUuids).allUuids(); |
There was a problem hiding this comment.
these first lines are the same as in renameRootNetworkTag
=> create small private function to avoid fixing this in two places lates
There was a problem hiding this comment.
Can you suggest something because I don't see how to make it without adding more code ?
There was a problem hiding this comment.
you can create record hold both result of what you called ownedUuids and sharedTreesUuids ...
never mind it can be done next time
There was a problem hiding this comment.
Yes but it add more codes, create a record used only once, and don't make it clearer IMO, unless I haven't understand
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
…pplicabilities' into HEAD Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
…pplicabilities' into feat/new-root-network-applicability Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
…-applicability Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com> # Conflicts: # src/main/java/org/gridsuite/modification/server/entities/ModificationEntity.java
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com> # Conflicts: # src/main/java/org/gridsuite/modification/server/repositories/NetworkModificationRepository.java # src/main/java/org/gridsuite/modification/server/service/NetworkModificationService.java
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
|



Replaces #918.
Adds
POST /network-modifications/root-network-tag?groupUuids&newTag: the modifications of the groups, and the shared ones they point to, get an applicability for the new tag unless they already have one. It isfalsewhen one of their applicabilities, for any tag, isfalse, andtrueotherwise.