Skip to content

Commit 990f355

Browse files
committed
chore: use location key instead of location name as resource tag
1 parent 00b2b01 commit 990f355

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

repository-postgresql/src/main/java/org/lfenergy/compas/scl/data/repository/postgresql/CompasSclDataPostgreSQLRepository.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -711,12 +711,12 @@ public boolean hasDuplicateLocationValues(String key, String name) {
711711

712712
@Override
713713
public void addLocationTags(ILocationMetaItem location) {
714-
String locationName = location.getName();
715-
ResourceTagItem locationNameTag = getResourceTag("LOCATION", locationName);
714+
String locationKey = location.getKey();
715+
ResourceTagItem locationNameTag = getResourceTag("LOCATION", locationKey);
716716

717717
if (locationNameTag == null) {
718-
createResourceTag("LOCATION", locationName);
719-
locationNameTag = getResourceTag("LOCATION", locationName);
718+
createResourceTag("LOCATION", locationKey);
719+
locationNameTag = getResourceTag("LOCATION", locationKey);
720720
}
721721
UUID locationUuid = UUID.fromString(location.getId());
722722
updateTagMappingForLocation(locationUuid, List.of(Objects.requireNonNull(locationNameTag)));
@@ -1141,9 +1141,9 @@ private List<IResourceTagItem> generateFields(String location, String sourceReso
11411141
}
11421142

11431143
private List<IResourceTagItem> generateFieldsFromResultSet(ResultSet resultSet, String examiner) throws SQLException {
1144-
String locationName = findLocationByUUID(UUID.fromString(resultSet.getString(ARCHIVEMETAITEM_LOCATION_FIELD))).getName();
1144+
String locationKey = findLocationByUUID(UUID.fromString(resultSet.getString(ARCHIVEMETAITEM_LOCATION_FIELD))).getKey();
11451145
return generateFields(
1146-
locationName,
1146+
locationKey,
11471147
resultSet.getString(ID_FIELD),
11481148
resultSet.getString("created_by"),
11491149
examiner,

0 commit comments

Comments
 (0)