01: /*
02:
03: Derby - Class org.apache.derby.impl.sql.execute.IndexConstantAction
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.execute;
23:
24: import org.apache.derby.iapi.services.sanity.SanityManager;
25: import org.apache.derby.iapi.error.StandardException;
26: import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
27:
28: import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor;
29: import org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor;
30: import org.apache.derby.iapi.sql.dictionary.DataDescriptorGenerator;
31: import org.apache.derby.iapi.sql.dictionary.DataDictionary;
32: import org.apache.derby.iapi.sql.dictionary.DataDictionaryContext;
33: import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
34: import org.apache.derby.iapi.sql.dictionary.TableDescriptor;
35:
36: import org.apache.derby.iapi.sql.execute.ConstantAction;
37: import org.apache.derby.iapi.store.access.TransactionController;
38:
39: import org.apache.derby.catalog.UUID;
40:
41: /**
42: * This class is the superclass for the classes that describe actions
43: * that are ALWAYS performed for a CREATE/DROP INDEX Statement at Execution time.
44: *
45: * @author Jerry Brenner
46: */
47:
48: public abstract class IndexConstantAction extends
49: DDLSingleTableConstantAction {
50:
51: String indexName;
52: String tableName;
53: String schemaName;
54:
55: // CONSTRUCTORS
56:
57: /**
58: * Make the ConstantAction for a CREATE/DROP INDEX statement.
59: *
60: * @param tableId The table uuid
61: * @param indexName Index name.
62: * @param tableName The table name
63: * @param schemaName Schema that index lives in.
64: *
65: */
66: protected IndexConstantAction(UUID tableId, String indexName,
67: String tableName, String schemaName) {
68: super (tableId);
69: this .indexName = indexName;
70: this .tableName = tableName;
71: this .schemaName = schemaName;
72:
73: if (SanityManager.DEBUG) {
74: SanityManager.ASSERT(schemaName != null,
75: "Schema name is null");
76: }
77: }
78:
79: // CLASS METHODS
80:
81: /**
82: * Get the index name.
83: *
84: * @return the name of the index
85: */
86: public String getIndexName() {
87: return indexName;
88: }
89:
90: /**
91: * Set the index name at execution time.
92: * Useful for unnamed constraints which have a backing index.
93: *
94: * @param indexName The (generated) index name.
95: */
96: public void setIndexName(String indexName) {
97: this.indexName = indexName;
98: }
99: }
|