예제 #1
0
        public override bool BuildWhere(ExtentStatement statement, string alias)
        {
            var schema = statement.Schema;

            if (this.instanceClasses.Length == 1)
            {
                statement.Append(alias + "." + schema.TypeId + "=" + statement.AddParameter(this.instanceClasses[0].Id) + " ");
            }
            else if (this.instanceClasses.Length > 1)
            {
                statement.Append(" ( ");
                for (var i = 0; i < this.instanceClasses.Length; i++)
                {
                    statement.Append(alias + "." + schema.TypeId + "=" + statement.AddParameter(this.instanceClasses[i].Id));
                    if (i < this.instanceClasses.Length - 1)
                    {
                        statement.Append(" OR ");
                    }
                }

                statement.Append(" ) ");
            }

            return(this.Include);
        }
예제 #2
0
        public override bool BuildWhere(ExtentStatement statement, string alias)
        {
            var schema = statement.Schema;

            statement.Append(" (" + alias + "." + schema.Column(this.roleType) + " BETWEEN " + statement.AddParameter(this.first) + " AND " + statement.AddParameter(this.second) + ")");
            return(this.Include);
        }
예제 #3
0
파일: RoleLike.cs 프로젝트: lulzzz/allors2
        public override bool BuildWhere(ExtentStatement statement, string alias)
        {
            var schema = statement.Schema;

            statement.Append(" " + alias + "." + schema.Column(this.role) + " LIKE " + statement.AddParameter(this.like));
            return(this.Include);
        }
예제 #4
0
        public override bool BuildWhere(ExtentStatement statement, string alias)
        {
            var schema = statement.Schema;

            if (this.roleType.ObjectType is IUnit)
            {
                statement.Append(" " + alias + "." + schema.Column(this.roleType) + "=" + statement.AddParameter(this.obj));
            }
            else
            {
                var allorsObject = (IObject)this.obj;

                if (this.roleType.RelationType.ExistExclusiveClasses)
                {
                    statement.Append(" (" + alias + "." + schema.Column(this.roleType) + " IS NOT NULL AND ");
                    statement.Append(" " + alias + "." + schema.Column(this.roleType) + "=" + allorsObject.Strategy.ObjectId + ")");
                }
                else
                {
                    statement.Append(" (" + this.roleType.SingularPropertyName + "_R." + schema.RoleId + " IS NOT NULL AND ");
                    statement.Append(" " + this.roleType.SingularPropertyName + "_R." + schema.RoleId + "=" + allorsObject.Strategy.ObjectId + ")");
                }
            }

            return(this.Include);
        }