public SelectFilter( ITable table, QueryFilter query, List<SortCriteria> sorts) : this(table, query, sorts, false) { }
public SelectFilter( ITable table, QueryFilter query, List<SortCriteria> sorts, bool isCount, List<IColumn> columns) { this.table = table; this.query = query; this.sorts = sorts; this.isCount = isCount; this.columns = columns; if (this.columns == null) { this.columns = new List<IColumn>(); foreach (IColumn col in this.table.Columns) { if (col.ColumnLocation == ColumnLocation.Database) { this.columns.Add(col); } } } }
public int GetRowCount(QueryFilter query) { using (DatabaseCountOperator queryOperator = new DatabaseCountOperator(this, query)) { return queryOperator.Execute(); } }
public SelectFilter( ITable table, QueryFilter query, List<SortCriteria> sorts, bool isCount) : this(table, query, sorts, isCount, null) { }
public OrFilter(QueryFilter filter1, QueryFilter filter2) { if (filter1 == null || filter2 == null) { throw new ArgumentNullException("One of the filters is null"); } this.subFilters.Add(filter1); this.subFilters.Add(filter2); }
public DatabaseQueryOperator( ITable table, QueryFilter query) { this.table = table; this.query = query; if (!(query is SelectFilter)) { throw new Exception("Invalid query filter. It should be a select filter"); } this.connection = DatabaseConnectionFactory.Instance.CreateDatabaseConnection(); }
public DatabaseCountOperator( ITable table, QueryFilter query) { this.table = table; this.query = query; if (!(query is SelectFilter) || !((SelectFilter)query).IsCount) { throw new Exception("Invalid query filter. It should be a select filter and should have IsCount set to true"); } this.connection = DatabaseConnectionFactory.Instance.CreateDatabaseConnection(); }
public List<ITableRow> QueryRows(QueryFilter query) { using (DatabaseQueryOperator queryOperator = new DatabaseQueryOperator(this, query)) { return queryOperator.Execute(); } }