From f83ee767b0f6f43ffaaed76f67b36da9f626fd36 Mon Sep 17 00:00:00 2001 From: Rehili Ghazwa Date: Fri, 6 Dec 2024 14:06:58 +0100 Subject: [PATCH] code review remarks --- .../LccConverterStationCreationEntity.java | 4 ++- .../equipment/creation/LccCreationEntity.java | 1 + ...34Z.xml => changelog_20241206T123930Z.xml} | 36 +++++++++---------- .../db/changelog/db.changelog-master.yaml | 2 +- 4 files changed, 23 insertions(+), 20 deletions(-) rename src/main/resources/db/changelog/changesets/{changelog_20241127T132034Z.xml => changelog_20241206T123930Z.xml} (74%) diff --git a/src/main/java/org/gridsuite/modification/server/entities/equipment/creation/LccConverterStationCreationEntity.java b/src/main/java/org/gridsuite/modification/server/entities/equipment/creation/LccConverterStationCreationEntity.java index 0c1796688..6ca292a14 100644 --- a/src/main/java/org/gridsuite/modification/server/entities/equipment/creation/LccConverterStationCreationEntity.java +++ b/src/main/java/org/gridsuite/modification/server/entities/equipment/creation/LccConverterStationCreationEntity.java @@ -28,6 +28,7 @@ @Getter @Entity @Table(name = "lccConverterStationCreation") +@PrimaryKeyJoinColumn(foreignKey = @ForeignKey(name = "lcc_converter_station_creation_id_fk_constraint")) public class LccConverterStationCreationEntity extends InjectionCreationEntity { @Id @GeneratedValue(strategy = GenerationType.AUTO) @@ -41,7 +42,8 @@ public class LccConverterStationCreationEntity extends InjectionCreationEntity { private Float powerFactor; @ElementCollection - @CollectionTable(name = "shunt_compensator_on_side") + @CollectionTable(name = "shunt_compensator_on_side", + foreignKey = @ForeignKey(name = "lcc_converter_station_creation_shunt_compensators_on_side_fk")) private List shuntCompensatorsOnSide; public LccConverterStationCreationEntity(LccConverterStationCreationInfos converterStationCreationInfos) { diff --git a/src/main/java/org/gridsuite/modification/server/entities/equipment/creation/LccCreationEntity.java b/src/main/java/org/gridsuite/modification/server/entities/equipment/creation/LccCreationEntity.java index cf2b576e7..4e5780e39 100644 --- a/src/main/java/org/gridsuite/modification/server/entities/equipment/creation/LccCreationEntity.java +++ b/src/main/java/org/gridsuite/modification/server/entities/equipment/creation/LccCreationEntity.java @@ -26,6 +26,7 @@ @Getter @Entity @Table(name = "lccCreation") +@PrimaryKeyJoinColumn(foreignKey = @ForeignKey(name = "lcc_creation_id_fk_constraint")) public class LccCreationEntity extends EquipmentCreationEntity { @Column private Double nominalV; diff --git a/src/main/resources/db/changelog/changesets/changelog_20241127T132034Z.xml b/src/main/resources/db/changelog/changesets/changelog_20241206T123930Z.xml similarity index 74% rename from src/main/resources/db/changelog/changesets/changelog_20241127T132034Z.xml rename to src/main/resources/db/changelog/changesets/changelog_20241206T123930Z.xml index df4a1f5e7..fa48dd055 100644 --- a/src/main/resources/db/changelog/changesets/changelog_20241127T132034Z.xml +++ b/src/main/resources/db/changelog/changesets/changelog_20241206T123930Z.xml @@ -1,6 +1,6 @@ - + @@ -17,7 +17,7 @@ - + @@ -33,36 +33,36 @@ - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + diff --git a/src/main/resources/db/changelog/db.changelog-master.yaml b/src/main/resources/db/changelog/db.changelog-master.yaml index b75d6d84d..6f2ec9372 100644 --- a/src/main/resources/db/changelog/db.changelog-master.yaml +++ b/src/main/resources/db/changelog/db.changelog-master.yaml @@ -320,4 +320,4 @@ databaseChangeLog: file: changesets/changelog_20241015T130742Z.xml - include: relativeToChangelogFile: true - file: changesets/changelog_20241127T132034Z.xml \ No newline at end of file + file: changesets/changelog_20241206T123930Z.xml \ No newline at end of file