Example #1
0
 internal NotAssociationContainedInEnumerable(ExtentFiltered extent, IAssociationType association, IEnumerable <IObject> enumerable)
 {
     extent.CheckAssociation(association);
     PredicateAssertions.AssertAssociationContainedIn(association, this.enumerable);
     this.association = association;
     this.enumerable  = enumerable;
 }
 internal AssociationContainedInExtent(ExtentFiltered extent, IAssociationType association, Allors.Extent inExtent)
 {
     extent.CheckAssociation(association);
     PredicateAssertions.AssertAssociationContainedIn(association, inExtent);
     this.association = association;
     this.inExtent    = ((Extent)inExtent).ContainedInExtent;
 }
Example #3
0
 private void LazyUpgrade()
 {
     if (this.upgrade == null)
     {
         this.upgrade = new ExtentFiltered(this.strategy.Session, this.strategy, this.associationType);
     }
 }
 internal RoleContainedInExtent(ExtentFiltered extent, IRoleType role, Allors.Extent inExtent)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleContainedIn(role, inExtent);
     this.role     = role;
     this.inExtent = ((Extent)inExtent).ContainedInExtent;
 }
 internal RoleLessThanValue(ExtentFiltered extent, IRoleType roleType, object obj)
 {
     extent.CheckRole(roleType);
     PredicateAssertions.ValidateRoleLessThan(roleType, obj);
     this.roleType = roleType;
     this.obj      = roleType.Normalize(obj);
 }
 internal RoleEqualsRole(ExtentFiltered extent, IRoleType role, IRoleType equalsRole)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleEquals(role, equalsRole);
     this.role       = role;
     this.equalsRole = equalsRole;
 }
Example #7
0
 internal Not(ExtentFiltered extent)
 {
     this.extent = extent;
     if (extent.Strategy != null)
     {
         var allorsObject = extent.Strategy.GetObject();
         if (extent.AssociationType != null)
         {
             var role = extent.AssociationType.RoleType;
             if (role.IsMany)
             {
                 this.AddContains(role, allorsObject);
             }
             else
             {
                 this.AddEquals(role, allorsObject);
             }
         }
         else
         {
             var association = extent.RoleType.AssociationType;
             if (association.IsMany)
             {
                 this.AddContains(association, allorsObject);
             }
             else
             {
                 this.AddEquals(association, allorsObject);
             }
         }
     }
 }
Example #8
0
 internal AssociationInstanceOf(ExtentFiltered extent, IAssociationType association, IObjectType instanceType, IObjectType[] instanceClasses)
 {
     extent.CheckAssociation(association);
     PredicateAssertions.ValidateAssociationInstanceof(association, instanceType);
     this.association     = association;
     this.instanceClasses = instanceClasses;
 }
 internal RoleGreaterThanRole(ExtentFiltered extent, IRoleType role, IRoleType greaterThanRole)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleGreaterThan(role, greaterThanRole);
     this.role            = role;
     this.greaterThanRole = greaterThanRole;
 }
Example #10
0
 internal RoleContains(ExtentFiltered extent, IRoleType role, IObject allorsObject)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleContains(role, allorsObject);
     this.role         = role;
     this.allorsObject = allorsObject;
 }
Example #11
0
 internal RoleLike(ExtentFiltered extent, IRoleType role, string like)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleLikeFilter(role, like);
     this.role = role;
     this.like = like;
 }
 internal RoleContainedInEnumerable(ExtentFiltered extent, IRoleType role, IEnumerable <IObject> enumerable)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleContainedIn(role, enumerable);
     this.role       = role;
     this.enumerable = enumerable;
 }
 internal RoleLessThanRole(ExtentFiltered extent, IRoleType role, IRoleType lessThanRole)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleLessThan(role, lessThanRole);
     this.role         = role;
     this.lessThanRole = lessThanRole;
 }
Example #14
0
 internal RoleInstanceof(ExtentFiltered extent, IRoleType role, IObjectType instanceType, IObjectType[] instanceClasses)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleInstanceOf(role, instanceType);
     this.role            = role;
     this.instanceClasses = instanceClasses;
 }
Example #15
0
        protected CompositePredicate(ExtentFiltered extent)
        {
            this.Extent  = extent;
            this.Filters = new List <Predicate>(4);

            if (extent.Strategy != null)
            {
                var allorsObject = extent.Strategy.GetObject();
                if (extent.AssociationType != null)
                {
                    var role = extent.AssociationType.RoleType;
                    if (role.IsMany)
                    {
                        this.AddContains(role, allorsObject);
                    }
                    else
                    {
                        this.AddEquals(role, allorsObject);
                    }
                }
                else
                {
                    var association = extent.RoleType.AssociationType;
                    if (association.IsMany)
                    {
                        this.AddContains(association, allorsObject);
                    }
                    else
                    {
                        this.AddEquals(association, allorsObject);
                    }
                }
            }
        }
Example #16
0
 internal AssociationContains(ExtentFiltered extent, IAssociationType association, IObject allorsObject)
 {
     extent.CheckAssociation(association);
     PredicateAssertions.AssertAssociationContains(association, allorsObject);
     this.association  = association;
     this.allorsObject = allorsObject;
 }
Example #17
0
 internal RoleBetweenValue(ExtentFiltered extent, IRoleType roleType, object first, object second)
 {
     extent.CheckRole(roleType);
     PredicateAssertions.ValidateRoleBetween(roleType, first, second);
     this.roleType = roleType;
     this.first    = roleType.Normalize(first);
     this.second   = roleType.Normalize(second);
 }
Example #18
0
 internal RoleBetweenRole(ExtentFiltered extent, IRoleType role, IRoleType first, IRoleType second)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleBetween(role, first, second);
     this.role   = role;
     this.first  = first;
     this.second = second;
 }
Example #19
0
 internal RoleEqualsValue(ExtentFiltered extent, IRoleType roleType, object obj)
 {
     extent.CheckRole(roleType);
     PredicateAssertions.ValidateRoleEquals(roleType, obj);
     this.roleType = roleType;
     if (obj is Enum)
     {
         if (((IUnit)roleType.ObjectType).IsInteger)
         {
             this.obj = obj;
         }
         else
         {
             throw new Exception("Role Object Type " + roleType.ObjectType.Name + " doesn't support enumerations.");
         }
     }
     else
     {
         this.obj = roleType.ObjectType.IsUnit ? roleType.Normalize(obj) : obj;
     }
 }
Example #20
0
 internal RoleExists(ExtentFiltered extent, IRoleType role)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleExists(role);
     this.role = role;
 }
Example #21
0
 internal AssociationExists(ExtentFiltered extent, IAssociationType association)
 {
     extent.CheckAssociation(association);
     PredicateAssertions.ValidateAssociationExists(association);
     this.association = association;
 }