KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > impl > sql > compile > AllResultColumn


1 /*
2
3    Derby - Class org.apache.derby.impl.sql.compile.AllResultColumn
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to you under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derby.impl.sql.compile;
23
24 import org.apache.derby.iapi.sql.compile.C_NodeTypes;
25
26 import org.apache.derby.iapi.services.sanity.SanityManager;
27
28 import org.apache.derby.iapi.error.StandardException;
29
30 /**
31  * An AllResultColumn represents a "*" result column in a SELECT
32  * statement. It gets replaced with the appropriate set of columns
33  * at bind time.
34  *
35  * @author Jerry Brenner
36  */

37
38 public class AllResultColumn extends ResultColumn
39 {
40     private TableName tableName;
41
42     /**
43      * This initializer is for use in the parser for a "*".
44      *
45      * @param tableName Dot expression qualifying "*"
46      */

47     public void init(Object JavaDoc tableName)
48     {
49         this.tableName = (TableName) tableName;
50     }
51
52     /**
53      * Return the full table name qualification for this node
54      *
55      * @return Full table name qualification as a String
56      */

57     public String JavaDoc getFullTableName()
58     {
59         if (tableName == null)
60         {
61             return null;
62         }
63         else
64         {
65             return tableName.getFullTableName();
66         }
67     }
68
69     /**
70      * Make a copy of this ResultColumn in a new ResultColumn
71      *
72      * @return A new ResultColumn with the same contents as this one
73      *
74      * @exception StandardException Thrown on error
75      */

76     ResultColumn cloneMe() throws StandardException
77     {
78         if (SanityManager.DEBUG)
79         {
80             SanityManager.ASSERT(columnDescriptor == null,
81                     "columnDescriptor is expected to be non-null");
82         }
83
84         return (ResultColumn) getNodeFactory().getNode(
85                                     C_NodeTypes.ALL_RESULT_COLUMN,
86                                     tableName,
87                                     getContextManager());
88     }
89
90
91     public TableName getTableNameObject() {
92         return tableName;
93     }
94 }
95
Popular Tags