KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > daffodilwoods > daffodildb > server > sql99 > dql > execution > StringReference


1 package com.daffodilwoods.daffodildb.server.sql99.dql.execution;
2
3 import com.daffodilwoods.daffodildb.server.sql99.common.*;
4 import com.daffodilwoods.daffodildb.server.sql99.utils.*;
5 import com.daffodilwoods.database.resource.*;
6
7 /**
8  * It represents a reference. It is basically a columnName. It is required when
9  * modifications are preformed on the resultset of select query.
10  * <p>Title: </p>
11  * <p>Description: </p>
12  * <p>Copyright: Copyright (c) 2003</p>
13  * <p>Company: </p>
14  * @author unascribed
15  * @version 1.0
16  */

17
18 public class StringReference implements _Reference {
19
20    /**
21     * Represents the index of column.
22     */

23
24    private int index;
25    int size;
26
27    /**
28     * Represents the name of column.
29     */

30
31    private String JavaDoc columnName;
32
33    /**
34     * Represents the name of table.
35     */

36
37    private String JavaDoc tableName;
38
39    /**
40     * Represents the table.
41     */

42
43    private TableDetails table;
44
45    /**
46     * Represents the column.
47     */

48
49    private ColumnDetails cd;
50
51 private String JavaDoc reason;
52    public StringReference(ColumnDetails cc) throws DException {
53       cd = cc;
54       columnName = cd.getQualifiedColumnName();
55       tableName = cd.getNameOfTable();
56    }
57
58    /**
59     * Returns the name of column.
60     * @return
61     * @throws DException
62     */

63
64    public String JavaDoc getColumn() throws DException {
65       return columnName;
66    }
67
68    /**
69     * Returns the name of table.
70     * @return
71     * @throws DException
72     */

73
74    public String JavaDoc getTableName() throws DException {
75       return tableName;
76    }
77
78    /**
79     * Returns the index of column.
80     * @return
81     * @throws DException
82     */

83
84    public int getIndex() throws DException {
85       return index;
86    }
87
88    /**
89     * Sets the index of column.
90     * @param index0
91     * @throws DException
92     */

93
94    public void setIndex(int index0) throws DException {
95       index = index0;
96    }
97
98    /**
99     * Sets the table.
100     * @param table0
101     * @throws DException
102     */

103
104    public void setTableDetails(TableDetails table0) throws DException {
105       table = table0;
106    }
107
108    /**
109     * Returns the table.
110     * @return
111     * @throws DException
112     */

113
114    public TableDetails getTableDetails() throws DException {
115       return table;
116    }
117
118    /**
119     * Returns the qualified name of column.
120     * @return
121     * @throws DException
122     */

123
124    public String JavaDoc getQualifiedColumnName() throws DException {
125       return columnName;
126    }
127
128    /**
129     * Returns the column.
130     * @return
131     */

132
133    public ColumnDetails getColumnDetails() {
134       return cd;
135    }
136
137    /**
138     * All the following methods are never called for this reference.
139     */

140
141    public int getReferenceType() throws DException {
142       /**@todo: Implement this com.daffodilwoods.daffodildb.server.sql99.utils._Reference method*/
143       throw new java.lang.UnsupportedOperationException JavaDoc(
144       "Method getReferenceType() not yet implemented.");
145    }
146
147    public String JavaDoc toString() {
148       return " TABLENAME : " + tableName + " COLUMNNAME : " + columnName;
149    }
150
151    public String JavaDoc getTriggerTableAlias() throws DException {
152       throw new java.lang.UnsupportedOperationException JavaDoc(
153             "Method getTriggerTableAlias() not yet implemented.");
154    }
155
156    public int getDatatype() throws DException {
157       throw new UnsupportedOperationException JavaDoc();
158    }
159
160    public void setDatatype(int type) throws DException {
161       throw new UnsupportedOperationException JavaDoc();
162    }
163
164    public void setSize(int size0) throws DException {
165         size = size0;
166      }
167
168      public int getSize() throws DException {
169         return size;
170      }
171      public void setReason(String JavaDoc reason0) throws DException {
172    reason = reason0;
173   }
174
175   public String JavaDoc getReason() throws DException {
176     return reason;
177 }
178
179  /* Done by Kaushik on 10/09/2004 to solve Bug No.11173 */
180    boolean isCloned;
181    public boolean isCloned(){
182       return isCloned;
183    }
184    public void setCloned(boolean isCloned0){
185       isCloned=isCloned0;
186    }
187
188
189 }
190
Popular Tags