01: package net.sourceforge.jaxor.parser;
02:
03: public class Query {
04: private String _name;
05: private String _sql;
06: private String _query;
07: private final ParamList _params = new ParamList();
08:
09: public Query() {
10: }
11:
12: public Query(String name, String sql) {
13: _name = name;
14: _sql = sql;
15: }
16:
17: public void setQuery(String query) {
18: _query = query;
19: }
20:
21: public void setName(String _name) {
22: this ._name = _name;
23: }
24:
25: public void setSql(String _sql) {
26: this ._sql = _sql;
27: }
28:
29: public String getName() {
30: return _name;
31: }
32:
33: public String getQueryType() {
34: if (_query != null)
35: return "query";
36: else
37: return "find";
38: }
39:
40: public String getSql() {
41: if (_query != null)
42: return "\"" + _query + "\"";
43: return "\"" + _sql.trim() + "\"";
44: }
45:
46: public void addParam(Param p) {
47: _params.add(p);
48: }
49:
50: public ParamList getParams() {
51: return _params;
52: }
53:
54: public String getMethodName() {
55: return getName();
56: }
57: }
|