Skip to content

Conversation

@ghazwarhili
Copy link
Contributor

PR Summary

rework export network file

@Lazy StudyService studyService,
RootNetworkService rootNetworkService,
RootNetworkNodeInfoService rootNetworkNodeInfoService,
DirectoryService directoryService) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reformatted code to be reverted

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


@ElementCollection
@CollectionTable(
name = "exportUuids",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name = "exportUuids",
name = "node_export",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@CollectionTable(
name = "exportUuids",
joinColumns = @JoinColumn(name = "root_network_node_info_id"),
foreignKey = @ForeignKey(name = "rootNetworkNodeInfo_exportUuids_fk")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
foreignKey = @ForeignKey(name = "rootNetworkNodeInfo_exportUuids_fk")
foreignKey = @ForeignKey(name = "rootNetworkNodeInfo_nodeExport_fk")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

joinColumns = @JoinColumn(name = "root_network_node_info_id"),
foreignKey = @ForeignKey(name = "rootNetworkNodeInfo_exportUuids_fk")
)
@MapKeyColumn(name = "export_uuid_key")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@MapKeyColumn(name = "export_uuid_key")
@MapKeyColumn(name = "export_uuid")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@MapKeyColumn(name = "export_uuid_key")
@Column(name = "status")
@Enumerated(EnumType.STRING)
private Map<UUID, ExportNetworkStatus> exportNetworkUuids = new HashMap<>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Entries in the sub table should be deleted when the node is unbuild (and also when a modification is added to the node ? to be done later maybe)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see

public InvalidateNodeInfos invalidateRootNetworkNode(RootNetworkNodeInfoEntity rootNetworkNodeInfoEntity, InvalidateNodeTreeParameters invalidateTreeParameters) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ll look into how to do it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And it would be simpler by using a NodeExportEmbeddable and remove @MapKeyColumn and @Enumerated.
After your PR, Bassel will add some columns to this table

uriComponentsBuilder.queryParam("fileName", fileName);
}
String receiver = URLEncoder.encode(objectMapper.writeValueAsString(new NetworkExportReceiver(studyUuid, userId)), StandardCharsets.UTF_8);
String receiver = URLEncoder.encode(objectMapper.writeValueAsString(new NetworkExportReceiver(studyUuid, nodeUuid, rootNetworkUuid, userId)), StandardCharsets.UTF_8);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you add this ? I guess it's not used as you didn't change the conversion-server

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need it because I use nodeUuid and rootNetworkUuid to look up the rootNetworkNodeInfoEntity. Even if the conversion-server wasn’t changed, these values are required for that lookup

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need it in some other methods yes. But not this one that is dedicated to the request to network-conversion-server

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hum ok it's for the nodeUuid and rootNetworkUuid to be present in the notification ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rootNetworkUuid and nodeUuid removed
done

joinColumns = @JoinColumn(name = "root_network_node_info_id"),
foreignKey = @ForeignKey(name = "rootNetworkNodeInfo_nodeExport_fk")
)
private Map<UUID, NodeExportEmbeddable> nodeExportNetwork = new HashMap<>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a list and add exportUuid to NodeExportEmbeddable ?

Copy link
Contributor Author

@ghazwarhili ghazwarhili Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

map replaced by list
done

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants