Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.0/Cloud)

88169: Merged V4.2-BUG-FIX (4.2.4) to HEAD-BUG-FIX (5.0/Cloud)
      87959: Merged DEV (4.2.4) to V4.2-BUG-FIX (4.2.4)
         87891: MNT-12367 : Relaxed mode for mandatory association not possible
         Added support for relaxed mode of mandatory association target.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@94563 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2015-01-31 09:58:45 +00:00
parent 37871c2618
commit c5a524e616
3 changed files with 35 additions and 2 deletions

View File

@@ -125,8 +125,9 @@ public class AssocTargetMultiplicityIntegrityEvent extends AbstractIntegrityEven
// get the source multiplicity
boolean mandatory = assocDef.isTargetMandatory();
boolean allowMany = assocDef.isTargetMany();
boolean enforced = assocDef.isTargetMandatoryEnforced();
// do we need to check
if (!mandatory && allowMany)
if (!(mandatory && enforced) && allowMany)
{
// it is not mandatory and it allows many on both sides of the assoc
return;
@@ -165,7 +166,7 @@ public class AssocTargetMultiplicityIntegrityEvent extends AbstractIntegrityEven
actualSize = targetAssocRefs.size();
}
if ((mandatory && actualSize == 0) || (!allowMany && actualSize > 1))
if (((mandatory && enforced) && actualSize == 0) || (!allowMany && actualSize > 1))
{
if (actualSize == 0)
{