コード例 #1
0
        protected override long[] GetObjectIds()
        {
            this.first.Session.Flush();

            var statement = new AllorsExtentStatementRootSql(this);

            this.BuildSql(statement);

            statement.Sorter?.BuildOrder(this.Sorter, this.Session.Database.Mapping, statement);

            var objects = new List <long>();

            using (var command = statement.CreateSqlCommand())
            {
                using (DbDataReader reader = command.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        var objectId = long.Parse(reader.GetValue(0).ToString());
                        objects.Add(objectId);
                    }

                    reader.Close();
                }
            }

            return(objects.ToArray());
        }
コード例 #2
0
        protected override long[] GetObjectIds()
        {
            if (this.strategy != null)
            {
                if (this.role != null)
                {
                    return(this.strategy.ExtentGetCompositeRoles(this.role.RelationType));
                }

                return(this.strategy.ExtentGetCompositeAssociations(this.association.RelationType));
            }

            if (!this.type.ExistClass)
            {
                return(Session.EmptyObjectIds);
            }

            this.session.Flush();

            var statement = new AllorsExtentStatementRootSql(this);
            var objects   = new List <long>();

            this.BuildSql(statement);

            statement.Sorter?.BuildOrder(statement.Sorter, this.Mapping, statement);

            using (var command = statement.CreateSqlCommand())
            {
                using (DbDataReader reader = command.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        var objectId = long.Parse(reader.GetValue(0).ToString());
                        objects.Add(objectId);
                    }

                    reader.Close();
                }
            }

            return(objects.ToArray());
        }
コード例 #3
0
 internal AllorsExtentStatementChildSql(AllorsExtentStatementRootSql root, AllorsExtentSql extent, IAssociationType association)
     : base(extent)
 {
     this.root        = root;
     this.association = association;
 }
コード例 #4
0
 internal AllorsExtentStatementChildSql(AllorsExtentStatementRootSql root, AllorsExtentSql extent, IRoleType role)
     : base(extent)
 {
     this.root = root;
     this.role = role;
 }
コード例 #5
0
ファイル: ExtentStatement.cs プロジェクト: whesius/allors
 internal AllorsExtentStatementChildSql(AllorsExtentStatementRootSql root, AllorsExtentSql extent, IAssociationType association)
     : base(extent)
 {
     this.root = root;
     this.association = association;
 }
コード例 #6
0
ファイル: ExtentStatement.cs プロジェクト: whesius/allors
 internal AllorsExtentStatementChildSql(AllorsExtentStatementRootSql root, AllorsExtentSql extent, IRoleType role)
     : base(extent)
 {
     this.root = root;
     this.role = role;
 }
コード例 #7
0
ファイル: ExtentFiltered.cs プロジェクト: whesius/allors
        protected override ObjectId[] GetObjectIds()
        {
            if (this.strategy != null)
            {
                if (this.role != null)
                {
                    return this.strategy.ExtentGetCompositeRoles(this.role);
                }

                return this.strategy.ExtentGetCompositeAssociations(this.association);
            }

            if (!this.type.ExistClass)
            {
                return ObjectId.EmptyObjectIds;
            }

            this.session.Flush();

            var statement = new AllorsExtentStatementRootSql(this);
            var objects = new List<ObjectId>();

            this.BuildSql(statement);

            if (statement.Sorter != null)
            {
                statement.Sorter.BuildOrder(statement.Sorter, this.Mapping, statement);
            }

            using (var command = statement.CreateSqlCommand())
            {
                using (DbDataReader reader = command.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        var objectId = this.session.Database.ObjectIds.Parse(reader.GetValue(0).ToString());
                        objects.Add(objectId);
                    }

                    reader.Close();
                }
            }

            return objects.ToArray();
        }
コード例 #8
0
ファイル: ExtentOperation.cs プロジェクト: whesius/allors
        protected override ObjectId[] GetObjectIds()
        {
            this.first.Session.Flush();

            var statement = new AllorsExtentStatementRootSql(this);

            this.BuildSql(statement);

            if (statement.Sorter != null)
            {
                statement.Sorter.BuildOrder(this.Sorter, this.Session.Database.Mapping, statement);
            }

            var objects = new List<ObjectId>();
            using (var command = statement.CreateSqlCommand())
            {
                using (DbDataReader reader = command.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        var objectId = this.Session.Database.ObjectIds.Parse(reader.GetValue(0).ToString());
                        objects.Add(objectId);
                    }

                    reader.Close();
                }
            }

            return objects.ToArray();
        }