1 package org.apache.turbine.util.db;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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 /***
30 * The name of the database table.
31 */
32 protected String tableName;
33
34 /***
35 * The name of the database column.
36 */
37 protected String columnName;
38
39 /***
40 * The concatenation of the table name and column name separated with a
41 * dot.
42 */
43 private String tableColumn;
44
45 public TableColumn(String tableName, String columnName)
46 {
47 this.tableName = tableName;
48 this.columnName = columnName;
49 this.tableColumn = (tableName + '.' + columnName);
50 }
51
52 /***
53 * Compares this object with another <code>TableColumn</code>.
54 *
55 * @param obj The object to compare to.
56 */
57 public boolean equals(Object obj)
58 {
59 if (this == obj)
60 {
61 return true;
62 }
63 else if (obj == null)
64 {
65 return false;
66 }
67 else if (obj instanceof TableColumn)
68 {
69 TableColumn tc = (TableColumn) obj;
70 return (tableName.equals(tc.tableName) &&
71 columnName.equals(tc.columnName));
72 }
73 else
74 {
75 return false;
76 }
77 }
78
79 /***
80 * The concatenation of the table name and column name separated with a
81 * dot.
82 *
83 * @return This object's string representation.
84 */
85 public String toString()
86 {
87 return tableColumn;
88 }
89 }