KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > iapi > sql > dictionary > TupleDescriptor


1 /*
2
3    Derby - Class org.apache.derby.iapi.sql.dictionary.TupleDescriptor
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.iapi.sql.dictionary;
23
24 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
25 import org.apache.derby.iapi.error.StandardException;
26
27 import org.apache.derby.catalog.DependableFinder;
28 import org.apache.derby.iapi.services.sanity.SanityManager;
29
30 import org.apache.derby.iapi.reference.SQLState;
31
32 // is it OK to do this?
33
import org.apache.derby.impl.sql.catalog.DDdependableFinder;
34 import org.apache.derby.impl.sql.catalog.DDColumnDependableFinder;
35
36 /**
37  * This is the superclass of all Descriptors. Users of DataDictionary should use
38  * the specific descriptor.
39  *
40  * @author Rick
41  * @author Manish
42  */

43
44 public class TupleDescriptor
45 {
46     //////////////////////////////////////////////////////////////////
47
//
48
// CONSTANTS
49
//
50
//////////////////////////////////////////////////////////////////
51

52     // list types
53

54     public static final int COLUMN_LIST = 1;
55     public static final int CONGLOMERATE_LIST = 2;
56     public static final int TRIGGER_LIST = 3;
57     public static final int CONSTRAINT_LIST = 4;
58
59     // generic items
60
/*
61     public static final int INDEX_PROPERTIES = 1;
62     public static final int TRIGGER_WHEN_TEXT = 2;
63     public static final int TRIGGER_ACTION_TEXT = 3;
64     public static final int TRIGGER_COMP_SCHEMA_ID = 4;
65     public static final int VIEW_DEPENDENCIES = 5;
66     public static final int SOURCE_COLUMN_IDS = 6;
67     public static final int UUID_ID = 7;
68     public static final int UUID_FLATNAME = 8;
69     public static final int UUID_TYPE = 9;
70     public static final int UUID_OTHER_ID = 10;
71     public static final int EXTERNAL_TYPE = 11;
72     public static final int PLUGIN_PRIMARY_KEY = 12;
73     public static final int SOURCE_JAR_FILE = 13;
74 */

75     //////////////////////////////////////////////////////////////////
76
//
77
// STATE
78
//
79
//////////////////////////////////////////////////////////////////
80

81     private DataDictionary dataDictionary;
82
83     //////////////////////////////////////////////////////////////////
84
//
85
// CONSTRUCTOR
86
//
87
//////////////////////////////////////////////////////////////////
88

89     public TupleDescriptor() {}
90
91     public TupleDescriptor(DataDictionary dataDictionary)
92     {
93         this.dataDictionary = dataDictionary;
94     }
95
96     protected DataDictionary getDataDictionary() throws StandardException
97     {
98         return dataDictionary;
99     }
100
101     protected void setDataDictionary(DataDictionary dd)
102     {
103         dataDictionary = dd;
104     }
105
106     /**
107      * Is this provider persistent? A stored dependency will be required
108      * if both the dependent and provider are persistent.
109      *
110      * @return boolean Whether or not this provider is persistent.
111      */

112     public boolean isPersistent()
113     {
114         return true;
115     }
116
117
118     //////////////////////////////////////////////////////////////////
119
//
120
// BEHAVIOR. These are only used by Replication!!
121
//
122
//////////////////////////////////////////////////////////////////
123

124
125     public DependableFinder getDependableFinder(int formatId)
126     {
127         return new DDdependableFinder(formatId);
128     }
129
130     DependableFinder getColumnDependableFinder(int formatId, byte[]
131                                                       columnBitMap)
132     {
133         return new DDColumnDependableFinder(formatId, columnBitMap);
134     }
135     
136     /** Each descriptor must identify itself with its type; i.e index, check
137      * constraint whatever.
138      */

139     public String JavaDoc getDescriptorType()
140     {
141         if (SanityManager.DEBUG) {SanityManager.NOTREACHED(); }
142         return null;
143     }
144     /* each descriptor has a name
145      */

146     public String JavaDoc getDescriptorName()
147     {
148         if (SanityManager.DEBUG) {SanityManager.NOTREACHED(); }
149         return null;
150     }
151 }
152
Popular Tags