1 /*
2 * $Id: StdCountSqlWriter.java,v 1.2 2005/03/21 18:45:55 mch Exp $
3 *
4 * (C) Copyright Astrogrid...
5 */
6
7 package org.astrogrid.tableserver.jdbc;
8
9 import org.astrogrid.query.returns.ReturnSpec;
10
11
12 /***
13 * For writing out Querys as SQL statment strings, as close as we can to 'standard SQL', for doing a 'count'.
14 */
15
16 public class StdCountSqlWriter extends StdSqlWriter
17 {
18
19 /*** Override all return spec to replace with count */
20 public void visitReturnSpec(ReturnSpec spec) {
21 select.append(" COUNT(*) ");
22 }
23
24 /*** Has no place in a count statement, so leave blank */
25 public void visitLimit(long limit) {
26 }
27
28 }
29
30 /*
31 $Log: StdCountSqlWriter.java,v $
32 Revision 1.2 2005/03/21 18:45:55 mch
33 Naughty big lump of changes
34
35 Revision 1.1 2005/03/10 16:42:55 mch
36 Split fits, sql and xdb
37
38 Revision 1.1.1.1 2005/02/17 18:37:35 mch
39 Initial checkin
40
41 Revision 1.1 2005/02/17 18:17:46 mch
42 Moved SqlWriters back into server as they need metadata information
43
44 Revision 1.1.1.1 2005/02/16 17:11:23 mch
45 Initial checkin
46
47 Revision 1.1.2.1 2004/12/08 23:23:37 mch
48 Made SqlWriter and AdqlWriter implement QueryVisitor
49
50 Revision 1.1.2.1 2004/12/08 18:36:40 mch
51 Added Vizier, rationalised SqlWriters etc, separated out TableResults from QueryResults
52
53
54 */
55
56
57
58