01: /*
02: * Copyright (C) 1999-2004 <a href="mailto:mandarax@jbdietrich.com">Jens Dietrich</a>
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */
18:
19: package org.mandarax.jdbc.server.sql;
20:
21: import java.util.Map;
22:
23: /**
24: * Represents a column term. I.e. either a column name, a constant or
25: * a complex term that uses a function.
26: * @author <A HREF="mailto:mandarax@jbdietrich.com">Jens Dietrich</A>
27: * @version 3.3.2 <29 December 2004>
28: * @since 3.0
29: */
30:
31: public abstract class ColumnTerm extends SQLObject {
32:
33: private ColumnTermContext owner = null;
34:
35: /**
36: * Constructor.
37: */
38: public ColumnTerm() {
39: super ();
40: }
41:
42: /**
43: * Gather the host variables.
44: * @param variables the list used to collect the variables
45: */
46: public abstract void prepare(java.util.List variables);
47:
48: /**
49: * @return ColumnTermContext
50: */
51: public ColumnTermContext getOwner() {
52: return owner;
53: }
54:
55: /**
56: * Sets the owner.
57: * @param owner The owner to set
58: */
59: void setOwner(ColumnTermContext owner) {
60: this .owner = owner;
61: }
62:
63: /**
64: * Normalize the object.
65: * @param typesByColumn associations between column names and (SQL) types
66: */
67: public void normalize(Map typesByColumn) {
68: // nothing to do here
69: }
70:
71: /**
72: * Get the associated (mandarax) variable name.
73: * @return a variable name
74: */
75: public String asVariableName() {
76: StringBuffer buf = new StringBuffer();
77: print(buf);
78: return buf.toString();
79: }
80:
81: }
|