Skip to content

Commit 3444440

Browse files
authored
API / Import does not overwrite metadata if any validation status (geonetwork#7703)
Test: * create record, validate * export as MEF * modify MEF * import with overwrite mode fails to update. If validation status table is empty, overwrite is working ```sql TRUNCATE TABLE validation; ``` Not sure this is the proper fix for that issue.
1 parent afb0d7a commit 3444440

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

domain/src/main/java/org/fao/geonet/repository/MetadataValidationRepositoryCustom.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public interface MetadataValidationRepositoryCustom {
5151
* @param metadataId the id of the metadata.
5252
* @return the number of rows deleted
5353
*/
54-
@Modifying(clearAutomatically=true)
54+
@Modifying(flushAutomatically = true, clearAutomatically = true)
5555
@Transactional
5656
@Query(value="DELETE FROM MetadataValidation v where v.id.metadataId = ?1 AND valtype != 'inspire'")
5757
int deleteAllInternalValidationById_MetadataId(Integer metadataId);

0 commit comments

Comments
 (0)