예제 #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;
 }
예제 #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;
 }
예제 #5
0
 internal RoleLessThanValue(ExtentFiltered extent, IRoleType roleType, object obj)
 {
     extent.CheckRole(roleType);
     PredicateAssertions.ValidateRoleLessThan(roleType, obj);
     this.roleType = roleType;
     this.obj      = roleType.Normalize(obj);
 }
예제 #6
0
 internal RoleEqualsRole(ExtentFiltered extent, IRoleType role, IRoleType equalsRole)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleEquals(role, equalsRole);
     this.role       = role;
     this.equalsRole = equalsRole;
 }
예제 #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);
             }
         }
     }
 }
예제 #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;
 }
예제 #10
0
 internal RoleContains(ExtentFiltered extent, IRoleType role, IObject allorsObject)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleContains(role, allorsObject);
     this.role         = role;
     this.allorsObject = allorsObject;
 }
예제 #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;
 }
예제 #13
0
 internal RoleLessThanRole(ExtentFiltered extent, IRoleType role, IRoleType lessThanRole)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleLessThan(role, lessThanRole);
     this.role         = role;
     this.lessThanRole = lessThanRole;
 }
예제 #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;
 }
예제 #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);
                    }
                }
            }
        }
예제 #16
0
 internal AssociationContains(ExtentFiltered extent, IAssociationType association, IObject allorsObject)
 {
     extent.CheckAssociation(association);
     PredicateAssertions.AssertAssociationContains(association, allorsObject);
     this.association  = association;
     this.allorsObject = allorsObject;
 }
예제 #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);
 }
예제 #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;
 }
예제 #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;
     }
 }
예제 #20
0
 internal RoleExists(ExtentFiltered extent, IRoleType role)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleExists(role);
     this.role = role;
 }
예제 #21
0
 internal AssociationExists(ExtentFiltered extent, IAssociationType association)
 {
     extent.CheckAssociation(association);
     PredicateAssertions.ValidateAssociationExists(association);
     this.association = association;
 }