01: package org.apache.turbine.util.db;
02:
03: /*
04: * Copyright 2001-2005 The Apache Software Foundation.
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License")
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */
18:
19: /**
20: * Models a specific column in a specific table.
21: *
22: * @author <a href="mailto:dlr@collab.net">Daniel Rall</a>
23: * @author <a href="mailto:jmcnally@collab.net">John McNally</a>
24: * @version $Id: TableColumn.java 264148 2005-08-29 14:21:04Z henning $
25: * @deprecated Use <a href="http://db.apache.org/torque/">Torque</a>.
26: */
27: public class TableColumn {
28: /**
29: * The name of the database table.
30: */
31: protected String tableName;
32:
33: /**
34: * The name of the database column.
35: */
36: protected String columnName;
37:
38: /**
39: * The concatenation of the table name and column name separated with a
40: * dot.
41: */
42: private String tableColumn;
43:
44: public TableColumn(String tableName, String columnName) {
45: this .tableName = tableName;
46: this .columnName = columnName;
47: this .tableColumn = (tableName + '.' + columnName);
48: }
49:
50: /**
51: * Compares this object with another <code>TableColumn</code>.
52: *
53: * @param obj The object to compare to.
54: */
55: public boolean equals(Object obj) {
56: if (this == obj) {
57: return true;
58: } else if (obj == null) {
59: return false;
60: } else if (obj instanceof TableColumn) {
61: TableColumn tc = (TableColumn) obj;
62: return (tableName.equals(tc.tableName) && columnName
63: .equals(tc.columnName));
64: } else {
65: return false;
66: }
67: }
68:
69: /**
70: * The concatenation of the table name and column name separated with a
71: * dot.
72: *
73: * @return This object's string representation.
74: */
75: public String toString() {
76: return tableColumn;
77: }
78: }
|