private void ReplaceWithCountFunc(SelectStmt stmt) { if (stmt.Query.Type == QueryType.Compound) { // メインクエリが複合クエリの場合はSELECT COUNT(*)文でラッピングする // (複合クエリのOrderBy句は変換処理なしにSELECT COUNT(*)のOrderByに使える) var singleQueryClause = SingleQuery.WrapInSelectStar(new AliasedQuery((IQueryClause)stmt.Query, false, "COUNT_")); // Limit句にはColumnを指定できないので変換処理は必要ない var singleQuery = new SingleQuery(singleQueryClause, stmt.Query.OrderBy, stmt.Query.Limit); stmt.Query = singleQuery; } this.ReplaceWithCountFunc((IQueryClause)stmt.Query); }
virtual public void VisitAfter(SelectStmt selectStmt) { }
// Statements virtual public void VisitBefore(SelectStmt selectStmt) { }
public void VisitAfter(SelectStmt selectStmt) { _visitor.VisitAfter(selectStmt); }
// Statements public void VisitBefore(SelectStmt selectStmt) { _visitor.VisitBefore(selectStmt); }