01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: ReadQueryString.java 3654 2007-02-06 06:50:16Z gbevin $
07: */
08: package com.uwyn.rife.database.queries;
09:
10: import com.uwyn.rife.database.capabilities.Capabilities;
11:
12: /**
13: * An instance of <code>ReadQueryString</code> can contain any kind of SQL
14: * query for read purposes.
15: *
16: * <p>This allows you to use any SQL together with the functionalities
17: * that are provided by {@link com.uwyn.rife.database.DbQueryManager}
18: *
19: * @author Geert Bevin (gbevin[remove] at uwyn dot com)
20: * @version $Revision: 3654 $
21: * @since 1.6
22: */
23: public class ReadQueryString implements ReadQuery {
24: private String mSql = null;
25:
26: /**
27: * Creates a new empty instance of <code>ReadQueryString</code>.
28: *
29: * @since 1.6
30: */
31: public ReadQueryString() {
32: }
33:
34: /**
35: * Creates a new instance of <code>ReadQueryString</code> with the
36: * specified SQL query.
37: *
38: * @param sql The SQL that should be executed by this query
39: * @since 1.6
40: */
41: public ReadQueryString(String sql) {
42: setSql(sql);
43: }
44:
45: /**
46: * Replaces the SQL that is executed by this query.
47: *
48: * @param sql The SQL that should be executed by this query
49: * @return this <code>ReadQueryString</code> instance.
50: * @since 1.6
51: */
52: public ReadQueryString sql(String sql) {
53: setSql(sql);
54: return this ;
55: }
56:
57: /**
58: * Replaces the SQL that is executed by this query.
59: *
60: * @param sql The SQL that should be executed by this query
61: * @since 1.6
62: */
63: public void setSql(String sql) {
64: mSql = sql;
65: }
66:
67: public void clear() {
68: mSql = null;
69: }
70:
71: public String getSql() {
72: return mSql;
73: }
74:
75: public QueryParameters getParameters() {
76: return null;
77: }
78:
79: public Capabilities getCapabilities() {
80: return null;
81: }
82:
83: public void setExcludeUnsupportedCapabilities(boolean flag) {
84: }
85: }
|