mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
Adding support for max cardinality
Fixing test_placeRecalculationAfterDelete (WIP)
This commit is contained in:
@@ -526,15 +526,19 @@ public class RelationshipServiceImpl implements RelationshipService {
|
||||
logRelationshipTypeDetailsForError(relationshipType);
|
||||
return false;
|
||||
}
|
||||
if (!verifyMaxCardinality(context, relationship.getLeftItem(),
|
||||
if (!relationship.getLatestVersionStatus().equals(LatestVersionStatus.RIGHT_ONLY)
|
||||
&& !verifyMaxCardinality(context, relationship.getLeftItem(),
|
||||
relationshipType.getLeftMaxCardinality(), relationshipType, true)) {
|
||||
//If RIGHT_ONLY => it's a copied relationship, and the count can be ignored
|
||||
log.warn("The relationship has been deemed invalid since the left item has more" +
|
||||
" relationships than the left max cardinality allows after we'd store this relationship");
|
||||
logRelationshipTypeDetailsForError(relationshipType);
|
||||
return false;
|
||||
}
|
||||
if (!verifyMaxCardinality(context, relationship.getRightItem(),
|
||||
if (!relationship.getLatestVersionStatus().equals(LatestVersionStatus.LEFT_ONLY)
|
||||
&& !verifyMaxCardinality(context, relationship.getRightItem(),
|
||||
relationshipType.getRightMaxCardinality(), relationshipType, false)) {
|
||||
//If LEFT_ONLY => it's a copied relationship, and the count can be ignored
|
||||
log.warn("The relationship has been deemed invalid since the right item has more" +
|
||||
" relationships than the right max cardinality allows after we'd store this relationship");
|
||||
logRelationshipTypeDetailsForError(relationshipType);
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user