示例#1
0
文件: Or.cs 项目: whesius/allors
        internal override bool BuildWhere(ExtentStatement statement, string alias)
        {
            if (this.Include)
            {
                var atLeastOneChildIncluded = false;
                statement.Append("(");
                foreach (var filter in this.Filters)
                {
                    if (atLeastOneChildIncluded)
                    {
                        statement.Append(" OR ");
                    }

                    if (filter.BuildWhere(statement, alias))
                    {
                        atLeastOneChildIncluded = true;
                    }
                }

                statement.Append(")");
                return atLeastOneChildIncluded;
            }

            return false;
        }
示例#2
0
        internal override bool BuildWhere(ExtentStatement statement, string alias)
        {
            if (this.Include)
            {
                var root = this.Extent.Filter == null || this.Extent.Filter.Equals(this);
                if (root)
                {
                    var wherePresent = !this.Extent.ObjectType.ExistExclusiveClass;
                    statement.Append(wherePresent ? " AND " : " WHERE ");
                }
                else
                {
                    statement.Append("(");
                }

                var atLeastOneChildIncluded = false;
                foreach (var filter in this.Filters)
                {
                    if (atLeastOneChildIncluded)
                    {
                        statement.Append(" AND ");
                    }

                    if (filter.BuildWhere(statement, alias))
                    {
                        atLeastOneChildIncluded = true;
                    }
                }

                if (!root)
                {
                    statement.Append(")");
                }

                return atLeastOneChildIncluded;
            }

            return false;
        }
示例#3
0
        public override bool BuildWhere(ExtentStatement statement, string alias)
        {
            if (this.Include)
            {
                var root = this.Extent.Filter == null || this.Extent.Filter.Equals(this);
                if (root)
                {
                    var wherePresent = !this.Extent.ObjectType.ExistExclusiveClass;
                    statement.Append(wherePresent ? " AND " : " WHERE ");
                }
                else
                {
                    statement.Append("(");
                }

                var atLeastOneChildIncluded = false;
                foreach (var filter in this.Filters)
                {
                    if (atLeastOneChildIncluded)
                    {
                        statement.Append(" AND ");
                    }

                    if (filter.BuildWhere(statement, alias))
                    {
                        atLeastOneChildIncluded = true;
                    }
                }

                if (!root)
                {
                    statement.Append(")");
                }

                return(atLeastOneChildIncluded);
            }

            return(false);
        }
示例#4
0
 public override void Setup(ExtentStatement statement)
 {
 }
示例#5
0
 internal abstract void Setup(ExtentStatement statement);
示例#6
0
 internal abstract bool BuildWhere(ExtentStatement statement, string alias);
示例#7
0
 internal abstract void Setup(ExtentStatement statement);
示例#8
0
 internal abstract bool BuildWhere(ExtentStatement statement, string alias);
示例#9
0
 public abstract void Setup(ExtentStatement statement);
示例#10
0
 public abstract bool BuildWhere(ExtentStatement statement, string alias);