01: /*
02:
03: Derby - Class org.apache.derby.impl.sql.compile.AllResultColumn
04:
05: Licensed to the Apache Software Foundation (ASF) under one or more
06: contributor license agreements. See the NOTICE file distributed with
07: this work for additional information regarding copyright ownership.
08: The ASF licenses this file to you under the Apache License, Version 2.0
09: (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: private TableName tableName;
40:
41: /**
42: * This initializer is for use in the parser for a "*".
43: *
44: * @param tableName Dot expression qualifying "*"
45: */
46: public void init(Object tableName) {
47: this .tableName = (TableName) tableName;
48: }
49:
50: /**
51: * Return the full table name qualification for this node
52: *
53: * @return Full table name qualification as a String
54: */
55: public String getFullTableName() {
56: if (tableName == null) {
57: return null;
58: } else {
59: return tableName.getFullTableName();
60: }
61: }
62:
63: /**
64: * Make a copy of this ResultColumn in a new ResultColumn
65: *
66: * @return A new ResultColumn with the same contents as this one
67: *
68: * @exception StandardException Thrown on error
69: */
70: ResultColumn cloneMe() throws StandardException {
71: if (SanityManager.DEBUG) {
72: SanityManager.ASSERT(columnDescriptor == null,
73: "columnDescriptor is expected to be non-null");
74: }
75:
76: return (ResultColumn) getNodeFactory().getNode(
77: C_NodeTypes.ALL_RESULT_COLUMN, tableName,
78: getContextManager());
79: }
80:
81: public TableName getTableNameObject() {
82: return tableName;
83: }
84: }
|