Beispiel #1
0
        public 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);
                    }
                }
            }
        }
Beispiel #2
0
 public RoleEqualsRole(ExtentFiltered extent, IRoleType role, IRoleType equalsRole)
 {
     extent.CheckRole(role);
     CompositePredicateAssertions.ValidateRoleEquals(role, equalsRole);
     this.role       = role;
     this.equalsRole = equalsRole;
 }
Beispiel #3
0
 public RoleLessThanRole(ExtentFiltered extent, IRoleType role, IRoleType lessThanRole)
 {
     extent.CheckRole(role);
     CompositePredicateAssertions.ValidateRoleLessThan(role, lessThanRole);
     this.role         = role;
     this.lessThanRole = lessThanRole;
 }
 public AssociationContainedInExtent(ExtentFiltered extent, IAssociationType association, Allors.Extent inExtent)
 {
     extent.CheckAssociation(association);
     CompositePredicateAssertions.AssertAssociationContainedIn(association, inExtent);
     this.association = association;
     this.inExtent    = ((Extent)inExtent).ContainedInExtent;
 }
Beispiel #5
0
 public AssociationContains(ExtentFiltered extent, IAssociationType association, IObject allorsObject)
 {
     extent.CheckAssociation(association);
     CompositePredicateAssertions.AssertAssociationContains(association, allorsObject);
     this.association  = association;
     this.allorsObject = allorsObject;
 }
Beispiel #6
0
 public RoleContainedInExtent(ExtentFiltered extent, IRoleType role, Allors.Extent inExtent)
 {
     extent.CheckRole(role);
     CompositePredicateAssertions.ValidateRoleContainedIn(role, inExtent);
     this.role     = role;
     this.inExtent = ((Extent)inExtent).ContainedInExtent;
 }
Beispiel #7
0
 public RoleContains(ExtentFiltered extent, IRoleType role, IObject allorsObject)
 {
     extent.CheckRole(role);
     CompositePredicateAssertions.ValidateRoleContains(role, allorsObject);
     this.role         = role;
     this.allorsObject = allorsObject;
 }
Beispiel #8
0
 public RoleGreaterThanRole(ExtentFiltered extent, IRoleType role, IRoleType greaterThanRole)
 {
     extent.CheckRole(role);
     CompositePredicateAssertions.ValidateRoleGreaterThan(role, greaterThanRole);
     this.role            = role;
     this.greaterThanRole = greaterThanRole;
 }
Beispiel #9
0
 public RoleGreaterThanValue(ExtentFiltered extent, IRoleType roleType, object obj)
 {
     extent.CheckRole(roleType);
     CompositePredicateAssertions.ValidateRoleGreaterThan(roleType, obj);
     this.roleType = roleType;
     this.obj      = roleType.Normalize(obj);
 }
 public RoleContainedInEnumerable(ExtentFiltered extent, IRoleType role, IEnumerable <IObject> enumerable)
 {
     extent.CheckRole(role);
     CompositePredicateAssertions.ValidateRoleContainedIn(role, this.enumerable);
     this.role       = role;
     this.enumerable = enumerable;
 }
Beispiel #11
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);
                    }
                }
            }
        }
Beispiel #12
0
 public RoleInstanceof(ExtentFiltered extent, IRoleType role, IObjectType instanceType, IObjectType[] instanceClasses)
 {
     extent.CheckRole(role);
     CompositePredicateAssertions.ValidateRoleInstanceOf(role, instanceType);
     this.role            = role;
     this.instanceClasses = instanceClasses;
 }
 public AssociationContainedInEnumerable(ExtentFiltered extent, IAssociationType association, IEnumerable <IObject> enumerable)
 {
     extent.CheckAssociation(association);
     CompositePredicateAssertions.AssertAssociationContainedIn(association, this.enumerable);
     this.association = association;
     this.enumerable  = enumerable;
 }
Beispiel #14
0
 public AssociationInstanceOf(ExtentFiltered extent, IAssociationType association, IObjectType instanceType, IObjectType[] instanceClasses)
 {
     extent.CheckAssociation(association);
     CompositePredicateAssertions.ValidateAssociationInstanceof(association, instanceType);
     this.association     = association;
     this.instanceClasses = instanceClasses;
 }
Beispiel #15
0
 public RoleLike(ExtentFiltered extent, IRoleType role, string like)
 {
     extent.CheckRole(role);
     CompositePredicateAssertions.ValidateRoleLikeFilter(role, like);
     this.role = role;
     this.like = like;
 }
Beispiel #16
0
 private void LazyUpgrade()
 {
     if (this.upgrade == null)
     {
         this.upgrade = new ExtentFiltered(this.strategy.SqlSession, this.strategy, this.roleType);
     }
 }
Beispiel #17
0
 public RoleBetweenValue(ExtentFiltered extent, IRoleType roleType, object first, object second)
 {
     extent.CheckRole(roleType);
     CompositePredicateAssertions.ValidateRoleBetween(roleType, first, second);
     this.roleType = roleType;
     this.first    = roleType.Normalize(first);
     this.second   = roleType.Normalize(second);
 }
Beispiel #18
0
 public RoleBetweenRole(ExtentFiltered extent, IRoleType role, IRoleType first, IRoleType second)
 {
     extent.CheckRole(role);
     CompositePredicateAssertions.ValidateRoleBetween(role, first, second);
     this.role   = role;
     this.first  = first;
     this.second = second;
 }
Beispiel #19
0
 public RoleEqualsValue(ExtentFiltered extent, IRoleType roleType, object obj)
 {
     extent.CheckRole(roleType);
     CompositePredicateAssertions.ValidateRoleEquals(roleType, obj);
     this.roleType = roleType;
     if (obj is Enum)
     {
         var unitType = roleType.ObjectType as IUnit;
         if (unitType != null && unitType.IsInteger)
         {
             this.obj = (int)obj;
         }
         else
         {
             throw new Exception("Role Object Type " + roleType.ObjectType.SingularName + " doesn't support enumerations.");
         }
     }
     else
     {
         this.obj = roleType.ObjectType is IUnit?roleType.Normalize(obj) : obj;
     }
 }
Beispiel #20
0
 public AssociationExists(ExtentFiltered extent, IAssociationType association)
 {
     extent.CheckAssociation(association);
     CompositePredicateAssertions.ValidateAssociationExists(association);
     this.association = association;
 }
Beispiel #21
0
 public RoleExists(ExtentFiltered extent, IRoleType role)
 {
     extent.CheckRole(role);
     CompositePredicateAssertions.ValidateRoleExists(role);
     this.role = role;
 }