Skip to content

Commit

Permalink
fix: keep fixing issues
Browse files Browse the repository at this point in the history
Signed-off-by: LE SAULNIER Kevin <[email protected]>
  • Loading branch information
LE SAULNIER Kevin committed Sep 18, 2024
1 parent ae83bf8 commit 702f984
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public NetworkModificationNodeInfoEntity toEntity(AbstractNode node) {
.nonEvacuatedEnergyResultUuid(timePointNodeInfo.getNonEvacuatedEnergyResultUuid())
.dynamicSimulationResultUuid(timePointNodeInfo.getDynamicSimulationResultUuid())
.stateEstimationResultUuid(timePointNodeInfo.getStateEstimationResultUuid())
.nodeBuildStatus(timePointNodeInfo.getNodeBuildStatus().toEntity()).build()))
.nodeBuildStatus(timePointNodeInfo.getNodeBuildStatus() != null ? timePointNodeInfo.getNodeBuildStatus().toEntity() : null).build()))
.build();
return completeEntityNodeInfo(node, networkModificationNodeInfoEntity);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,23 @@ public TimePointNodeInfoEntity(TimePointEntity timePoint, NetworkModificationNod
}

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "id")
private UUID id;

@ManyToOne
@JoinColumn(name = "timePointId")/*,*/
// referencedColumnName = "id",
// foreignKey = @ForeignKey)
@JoinColumn(name = "timePointId",
referencedColumnName = "id",
foreignKey = @ForeignKey)
private TimePointEntity timePoint;

@Column
UUID reportUuid;

@ManyToOne
@JoinColumn(name = "nodeInfoId")/*,
@JoinColumn(name = "nodeInfoId",
referencedColumnName = "idNode",
foreignKey = @ForeignKey)*/
foreignKey = @ForeignKey)
private NetworkModificationNodeInfoEntity nodeInfo;

@Column
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,7 @@ public NodeEntity createRoot(StudyEntity study, UUID importReportUuid) {
.build()
))
.build();
RootNodeInfoEntity rootNodeInfoEntity = (RootNodeInfoEntity) repositories.get(NodeType.ROOT).createNodeInfo(root);
timePointService.createTimePointNodeLink(rootNodeInfoEntity, study.getFirstTimepoint());
repositories.get(NodeType.ROOT).createNodeInfo(root);
return node;
}

Expand Down Expand Up @@ -483,6 +482,9 @@ public void createBasicTree(StudyEntity studyEntity, UUID importReportUuid, Time
NetworkModificationNode modificationNode = NetworkModificationNode
.builder()
.name("N1")
.timePointNetworkModificationNodeList(
List.of(TimePointNetworkModificationNode.builder()
.build()))
.build();
self.createNode(studyEntity, rootNodeEntity.getIdNode(), modificationNode, InsertMode.AFTER, null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,8 @@
@Service
public class TimePointService {
private final TimePointNetworkModificationNodeInfoRepository timePointNetworkModificationNodeInfoRepository;
private final NetworkModificationTreeService networkModificationTreeService;
private final NetworkModificationNodeInfoRepository networkModificationNodeInfoRepository;

public TimePointService(NetworkModificationTreeService networkModificationTreeService,
NetworkModificationNodeInfoRepository networkModificationNodeInfoRepository,
TimePointNetworkModificationNodeInfoRepository timePointNetworkModificationNodeInfoRepository) {
this.networkModificationTreeService = networkModificationTreeService;
this.networkModificationNodeInfoRepository = networkModificationNodeInfoRepository;

public TimePointService(TimePointNetworkModificationNodeInfoRepository timePointNetworkModificationNodeInfoRepository) {
this.timePointNetworkModificationNodeInfoRepository = timePointNetworkModificationNodeInfoRepository;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@
<changeSet author="lesaulnierkev (generated)" id="1726585358232-20">
<addForeignKeyConstraint baseColumnNames="time_point_node_info_entity_id" baseTableName="time_point_node_info_entity_modifications_to_exclude" constraintName="timePointNodeInfoEntity_modificationsToExclude_fk" deferrable="false" initiallyDeferred="false" referencedColumnNames="id" referencedTableName="time_point_node_info" validate="true"/>
</changeSet>
<changeSet author="lesaulnierkev (generated)" id="1726585358232-21">
<dropForeignKeyConstraint baseTableName="NETWORK_MODIFICATION_NODE_INFO_ENTITY_MODIFICATIONS_TO_EXCLUDE" constraintName="NETWORKMODIFICATIONNODEINFOENTITY_MODIFICATIONSTOEXCLUDE_FK"/>
</changeSet>
<changeSet author="lesaulnierkev (generated)" id="1726585358232-22">
<dropTable tableName="NETWORK_MODIFICATION_NODE_INFO_ENTITY_MODIFICATIONS_TO_EXCLUDE"/>
</changeSet>
Expand Down

0 comments on commit 702f984

Please sign in to comment.