001: /*
002:
003: Derby - Class org.apache.derby.iapi.sql.dictionary.TupleDescriptor
004:
005: Licensed to the Apache Software Foundation (ASF) under one or more
006: contributor license agreements. See the NOTICE file distributed with
007: this work for additional information regarding copyright ownership.
008: The ASF licenses this file to you under the Apache License, Version 2.0
009: (the "License"); you may not use this file except in compliance with
010: the License. You may obtain a copy of the License at
011:
012: http://www.apache.org/licenses/LICENSE-2.0
013:
014: Unless required by applicable law or agreed to in writing, software
015: distributed under the License is distributed on an "AS IS" BASIS,
016: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: See the License for the specific language governing permissions and
018: limitations under the License.
019:
020: */
021:
022: package org.apache.derby.iapi.sql.dictionary;
023:
024: import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
025: import org.apache.derby.iapi.error.StandardException;
026:
027: import org.apache.derby.catalog.DependableFinder;
028: import org.apache.derby.iapi.services.sanity.SanityManager;
029:
030: import org.apache.derby.iapi.reference.SQLState;
031:
032: // is it OK to do this?
033: import org.apache.derby.impl.sql.catalog.DDdependableFinder;
034: import org.apache.derby.impl.sql.catalog.DDColumnDependableFinder;
035:
036: /**
037: * This is the superclass of all Descriptors. Users of DataDictionary should use
038: * the specific descriptor.
039: *
040: * @author Rick
041: * @author Manish
042: */
043:
044: public class TupleDescriptor {
045: //////////////////////////////////////////////////////////////////
046: //
047: // CONSTANTS
048: //
049: //////////////////////////////////////////////////////////////////
050:
051: // list types
052:
053: public static final int COLUMN_LIST = 1;
054: public static final int CONGLOMERATE_LIST = 2;
055: public static final int TRIGGER_LIST = 3;
056: public static final int CONSTRAINT_LIST = 4;
057:
058: // generic items
059: /*
060: public static final int INDEX_PROPERTIES = 1;
061: public static final int TRIGGER_WHEN_TEXT = 2;
062: public static final int TRIGGER_ACTION_TEXT = 3;
063: public static final int TRIGGER_COMP_SCHEMA_ID = 4;
064: public static final int VIEW_DEPENDENCIES = 5;
065: public static final int SOURCE_COLUMN_IDS = 6;
066: public static final int UUID_ID = 7;
067: public static final int UUID_FLATNAME = 8;
068: public static final int UUID_TYPE = 9;
069: public static final int UUID_OTHER_ID = 10;
070: public static final int EXTERNAL_TYPE = 11;
071: public static final int PLUGIN_PRIMARY_KEY = 12;
072: public static final int SOURCE_JAR_FILE = 13;
073: */
074: //////////////////////////////////////////////////////////////////
075: //
076: // STATE
077: //
078: //////////////////////////////////////////////////////////////////
079: private DataDictionary dataDictionary;
080:
081: //////////////////////////////////////////////////////////////////
082: //
083: // CONSTRUCTOR
084: //
085: //////////////////////////////////////////////////////////////////
086:
087: public TupleDescriptor() {
088: }
089:
090: public TupleDescriptor(DataDictionary dataDictionary) {
091: this .dataDictionary = dataDictionary;
092: }
093:
094: protected DataDictionary getDataDictionary()
095: throws StandardException {
096: return dataDictionary;
097: }
098:
099: protected void setDataDictionary(DataDictionary dd) {
100: dataDictionary = dd;
101: }
102:
103: /**
104: * Is this provider persistent? A stored dependency will be required
105: * if both the dependent and provider are persistent.
106: *
107: * @return boolean Whether or not this provider is persistent.
108: */
109: public boolean isPersistent() {
110: return true;
111: }
112:
113: //////////////////////////////////////////////////////////////////
114: //
115: // BEHAVIOR. These are only used by Replication!!
116: //
117: //////////////////////////////////////////////////////////////////
118:
119: public DependableFinder getDependableFinder(int formatId) {
120: return new DDdependableFinder(formatId);
121: }
122:
123: DependableFinder getColumnDependableFinder(int formatId,
124: byte[] columnBitMap) {
125: return new DDColumnDependableFinder(formatId, columnBitMap);
126: }
127:
128: /** Each descriptor must identify itself with its type; i.e index, check
129: * constraint whatever.
130: */
131: public String getDescriptorType() {
132: if (SanityManager.DEBUG) {
133: SanityManager.NOTREACHED();
134: }
135: return null;
136: }
137:
138: /* each descriptor has a name
139: */
140: public String getDescriptorName() {
141: if (SanityManager.DEBUG) {
142: SanityManager.NOTREACHED();
143: }
144: return null;
145: }
146: }
|