예제 #1
0
        public virtual Allors.Extent Intersect(Allors.Extent firstOperand, Allors.Extent secondOperand)
        {
            var firstExtent  = firstOperand as Extent ?? ((ExtentSwitch)firstOperand).Extent;
            var secondExtent = secondOperand as Extent ?? ((ExtentSwitch)secondOperand).Extent;

            return(new ExtentOperation(this, firstExtent, secondExtent, ExtentOperationType.Intersect));
        }
예제 #2
0
파일: Not.cs 프로젝트: lulzzz/allors2
 public ICompositePredicate AddContainedIn(IAssociationType association, Allors.Extent containingExtent)
 {
     this.CheckUnarity();
     this.extent.FlushCache();
     this.filter = new NotAssociationContainedInExtent(this.extent, association, containingExtent);
     return(this);
 }
예제 #3
0
파일: Not.cs 프로젝트: lulzzz/allors2
 public ICompositePredicate AddContainedIn(IRoleType role, Allors.Extent containingExtent)
 {
     this.CheckUnarity();
     this.extent.FlushCache();
     this.filter = new RoleContainedInExtent(this.extent, role, containingExtent);
     return(this);
 }
 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 AssociationContainedInExtent(ExtentFiltered extent, IAssociationType associationType, Allors.Extent containingExtent)
        {
            extent.CheckForAssociationType(associationType);
            PredicateAssertions.AssertAssociationContainedIn(associationType, containingExtent);

            this.associationType  = associationType;
            this.containingExtent = containingExtent;
        }
        internal RoleOneContainedInExtent(ExtentFiltered extent, IRoleType roleType, Allors.Extent containingExtent)
        {
            extent.CheckForRoleType(roleType);
            PredicateAssertions.ValidateRoleContainedIn(roleType, containingExtent);

            this.roleType         = roleType;
            this.containingExtent = containingExtent;
        }
예제 #7
0
        internal RoleManyContainedInExtent(ExtentFiltered extent, IRoleType roleType, Allors.Extent containingExtent)
        {
            extent.CheckForRoleType(roleType);
            PredicateAssertions.ValidateRoleContainedIn(roleType, containingExtent);

            this.roleType = roleType;
            this.containingExtent = containingExtent;
        }
예제 #8
0
 internal void CopyToConnected(Allors.Extent connectedExtent)
 {
     connectedExtent.AddSort(this.roleType, this.direction);
     if (this.subSorter != null)
     {
         this.subSorter.CopyToConnected(connectedExtent);
     }
 }
        internal AssociationContainedInExtent(ExtentFiltered extent, IAssociationType associationType, Allors.Extent containingExtent)
        {
            extent.CheckForAssociationType(associationType);
            PredicateAssertions.AssertAssociationContainedIn(associationType, containingExtent);

            this.associationType = associationType;
            this.containingExtent = containingExtent;
        }
예제 #10
0
        public ICompositePredicate AddContainedIn(IRoleType role, Allors.Extent containingExtent)
        {
            if (role.IsMany)
            {
                this.Filters.Add(new RoleManyContainedInExtent(this.extent, role, containingExtent));
            }
            else
            {
                this.Filters.Add(new RoleOneContainedInExtent(this.extent, role, containingExtent));
            }

            this.extent.Invalidate();
            return(this);
        }
예제 #11
0
        public ICompositePredicate AddContainedIn(IRoleType role, Allors.Extent containingExtent)
        {
            this.CheckUnarity();
            if (role.IsMany)
            {
                this.predicate = new RoleManyContainedInExtent(this.extent, role, containingExtent);
            }
            else
            {
                this.predicate = new RoleOneContainedInExtent(this.extent, role, containingExtent);
            }

            this.extent.Invalidate();
            return(this);
        }
예제 #12
0
        public virtual void SetCompositeRoles(IRelationType relationType, Allors.Extent roleObjects)
        {
            if (roleObjects == null || roleObjects.Count == 0)
            {
                this.RemoveCompositeRoles(relationType);
            }
            else
            {
                this.AssertExist();
                var roleType = relationType.RoleType;

                // TODO: use CompositeRoles
                var previousRoles = new List <long>(this.Roles.GetCompositeRoles(roleType));
                var newRoles      = new HashSet <long>();

                foreach (IObject roleObject in roleObjects)
                {
                    if (roleObject != null)
                    {
                        RoleAssertions.CompositeRolesChecks(this, roleType, roleObject);
                        var role = (Strategy)roleObject.Strategy;

                        if (!previousRoles.Contains(role.ObjectId))
                        {
                            this.Roles.AddCompositeRole(roleType, role);
                        }

                        newRoles.Add(role.ObjectId);
                    }
                }

                foreach (var previousRole in previousRoles)
                {
                    if (!newRoles.Contains(previousRole))
                    {
                        this.Roles.RemoveCompositeRole(roleType, this.SqlSession.GetOrCreateAssociationForExistingObject(previousRole).Strategy);
                    }
                }
            }
        }
예제 #13
0
 public void Build(Allors.Extent extent)
 {
     extent.AddSort(RoleType, this.Descending ? SortDirection.Descending : SortDirection.Ascending);
 }
예제 #14
0
 public AllorsPredicateRoleInExtentSql(AllorsExtentFilteredSql extent, IRoleType role, Allors.Extent inExtent)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleContainedIn(role, inExtent);
     this.role     = role;
     this.inExtent = (AllorsExtentSql)inExtent;
 }
예제 #15
0
 public Allors.Extent Except(Allors.Extent firstOperand, Allors.Extent secondOperand) => new ExtentOperation(((Extent)firstOperand).ContainedInExtent, ((Extent)secondOperand).ContainedInExtent, ExtentOperations.Except);
예제 #16
0
 public ICompositePredicate AddContainedIn(IAssociationType association, Allors.Extent containingExtent)
 {
     this.predicates.Add(new AssociationContainedInExtent(this.extent, association, containingExtent));
     this.extent.Invalidate();
     return(this);
 }
예제 #17
0
 public ICompositePredicate AddContainedIn(IRoleType role, Allors.Extent containingExtent)
 {
     this.Extent.FlushCache();
     this.Filters.Add(new RoleContainedInExtent(this.Extent, role, containingExtent));
     return(this);
 }
예제 #18
0
파일: Session.cs 프로젝트: lulzzz/allors2
 public Allors.Extent Intersect(Allors.Extent firstOperand, Allors.Extent secondOperand)
 {
     return(new ExtentOperation(((Extent)firstOperand).ContainedInExtent, ((Extent)secondOperand).ContainedInExtent, ExtentOperations.Intersect));
 }
예제 #19
0
 public ICompositePredicate AddContainedIn(IAssociationType association, Allors.Extent containingExtent)
 {
     this.Extent.FlushCache();
     this.Filters.Add(new AssociationContainedInExtent(this.Extent, association, containingExtent));
     return(this);
 }
예제 #20
0
 public AssociationContainedInExtent(ExtentFiltered extent, IAssociationType association, Allors.Extent inExtent)
 {
     extent.CheckAssociation(association);
     CompositePredicateAssertions.AssertAssociationContainedIn(association, inExtent);
     this.association = association;
     this.inExtent    = ((Extent)inExtent).ContainedInExtent;
 }