KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > impl > sql > execute > IndexConstantAction


1 /*
2
3    Derby - Class org.apache.derby.impl.sql.execute.IndexConstantAction
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.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 DDLSingleTableConstantAction
49 {
50
51     String JavaDoc indexName;
52     String JavaDoc tableName;
53     String JavaDoc 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(
67                                 UUID tableId,
68                                 String JavaDoc indexName,
69                                 String JavaDoc tableName,
70                                 String JavaDoc schemaName)
71     {
72         super(tableId);
73         this.indexName = indexName;
74         this.tableName = tableName;
75         this.schemaName = schemaName;
76
77         if (SanityManager.DEBUG)
78         {
79             SanityManager.ASSERT(schemaName != null, "Schema name is null");
80         }
81     }
82
83     // CLASS METHODS
84

85     /**
86       * Get the index name.
87       *
88       * @return the name of the index
89       */

90     public String JavaDoc getIndexName() { return indexName; }
91
92     /**
93      * Set the index name at execution time.
94      * Useful for unnamed constraints which have a backing index.
95      *
96      * @param indexName The (generated) index name.
97      */

98     public void setIndexName(String JavaDoc indexName)
99     {
100         this.indexName = indexName;
101     }
102 }
103
Popular Tags