01: /*
02: * DatabaseProcedure.java
03: *
04: * Copyright (C) 2002, 2003, 2004, 2005, 2006 Takis Diakoumis
05: *
06: * This program is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU General Public License
08: * as published by the Free Software Foundation; either version 2
09: * of the License, or any later version.
10: *
11: * This program is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: * GNU General Public License for more details.
15: *
16: * You should have received a copy of the GNU General Public License
17: * along with this program; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19: *
20: */
21:
22: package org.executequery.databasemediators;
23:
24: import java.util.Vector;
25:
26: /* ----------------------------------------------------------
27: * CVS NOTE: Changes to the CVS repository prior to the
28: * release of version 3.0.0beta1 has meant a
29: * resetting of CVS revision numbers.
30: * ----------------------------------------------------------
31: */
32:
33: /**
34: *
35: * @author Takis Diakoumis
36: * @version $Revision: 1.4 $
37: * @date $Date: 2006/05/14 06:56:54 $
38: */
39: public class DatabaseProcedure {
40:
41: private String name;
42: private Vector parameters;
43: private String schema;
44:
45: public DatabaseProcedure() {
46: parameters = new Vector();
47: }
48:
49: public DatabaseProcedure(String schema, String name) {
50: this ();
51: this .name = name;
52: this .schema = schema;
53: }
54:
55: public void setName(String name) {
56: this .name = name;
57: }
58:
59: public boolean hasParameters() {
60: return parameters.size() > 0;
61: }
62:
63: public String getName() {
64: return name;
65: }
66:
67: public void addParameter(String name, int type, int dataType,
68: String sqlType, int size) {
69: parameters.add(new ProcedureParameter(name, type, dataType,
70: sqlType, size));
71: }
72:
73: public ProcedureParameter[] getParameters() {
74: return (ProcedureParameter[]) parameters
75: .toArray(new ProcedureParameter[parameters.size()]);
76: }
77:
78: public String toString() {
79: return name;
80: }
81:
82: public String getSchema() {
83: return schema;
84: }
85:
86: public void setSchema(String schema) {
87: this.schema = schema;
88: }
89:
90: }
|