Exemplo n.º 1
0
        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.CreateSQLiteCommand())
            {
                using (DbDataReader reader = command.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        var objectId = new ObjectIdLong(reader.GetInt64(0));
                        objects.Add(objectId);
                    }

                    reader.Close();
                }
            }

            return(objects.ToArray());
        }
        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.CreateSQLiteCommand())
            {
                using (DbDataReader reader = command.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        var objectId = new ObjectIdLong(reader.GetInt64(0));
                        objects.Add(objectId);
                    }

                    reader.Close();
                }
            }

            return(objects.ToArray());
        }
Exemplo n.º 3
0
        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.CreateSQLiteCommand())
            {
                using (DbDataReader reader = command.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        var objectId = new ObjectIdLong(reader.GetInt64(0));
                        objects.Add(objectId);
                    }

                    reader.Close();
                }
            }

            return objects.ToArray();
        }
Exemplo n.º 4
0
 internal AllorsExtentStatementChildSql(AllorsExtentStatementRootSql root, AllorsExtentSql extent, IAssociationType association)
     : base(extent)
 {
     this.root        = root;
     this.association = association;
 }
Exemplo n.º 5
0
 internal AllorsExtentStatementChildSql(AllorsExtentStatementRootSql root, AllorsExtentSql extent, IRoleType role)
     : base(extent)
 {
     this.root = root;
     this.role = role;
 }
Exemplo n.º 6
0
        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.CreateSQLiteCommand())
            {
                using (DbDataReader reader = command.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        var objectId = new ObjectIdLong(reader.GetInt64(0));
                        objects.Add(objectId);
                    }

                    reader.Close();
                }
            }

            return objects.ToArray();
        }
Exemplo n.º 7
0
 internal AllorsExtentStatementChildSql(AllorsExtentStatementRootSql root, AllorsExtentSql extent, IAssociationType association)
     : base(extent)
 {
     this.root = root;
     this.association = association;
 }
Exemplo n.º 8
0
 internal AllorsExtentStatementChildSql(AllorsExtentStatementRootSql root, AllorsExtentSql extent, IRoleType role)
     : base(extent)
 {
     this.root = root;
     this.role = role;
 }