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()); }
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()); }
internal AllorsExtentStatementChildSql(AllorsExtentStatementRootSql root, AllorsExtentSql extent, IAssociationType association) : base(extent) { this.root = root; this.association = association; }
internal AllorsExtentStatementChildSql(AllorsExtentStatementRootSql root, AllorsExtentSql extent, IRoleType role) : base(extent) { this.root = root; this.role = role; }
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(); }
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(); }