001: /*
002:
003: Derby - Class org.apache.derby.iapi.sql.dictionary.SubCheckConstraintDescriptor
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.catalog.ReferencedColumns;
025: import org.apache.derby.catalog.UUID;
026:
027: import org.apache.derby.iapi.services.sanity.SanityManager;
028:
029: /**
030: * This interface is used to get information from a SubCheckConstraintDescriptor.
031: * A SubCheckConstraintDescriptor is used within the DataDictionary to
032: * get auxiliary constraint information from the system table
033: * that is auxiliary to sysconstraints.
034: *
035: * @version 0.1
036: * @author Jerry Brenner
037: */
038:
039: public class SubCheckConstraintDescriptor extends
040: SubConstraintDescriptor {
041: /** public interface to this class:
042: <ol>
043: <li>public String getConstraintText();</li>
044: <li>public ReferencedColumns getReferencedColumnsDescriptor();</li>
045: </ol>
046: */
047:
048: // Implementation
049: private ReferencedColumns referencedColumns;
050: private String constraintText;
051:
052: /**
053: * Constructor for a SubCheckConstraintDescriptor
054: *
055: * @param constraintId The UUID of the constraint.
056: * @param constraintText The text of the constraint definition.
057: * @param referencedColumns The columns referenced by the check constraint
058: */
059:
060: public SubCheckConstraintDescriptor(UUID constraintId,
061: String constraintText, ReferencedColumns referencedColumns) {
062: super (constraintId);
063: this .constraintText = constraintText;
064: this .referencedColumns = referencedColumns;
065: }
066:
067: /**
068: * Get the text of the check constraint definition.
069: *
070: * @return The text of the check constraint definition.
071: */
072: public String getConstraintText() {
073: return constraintText;
074: }
075:
076: /**
077: * Get the ReferencedColumns.
078: *
079: * @return The ReferencedColumns.
080: */
081: public ReferencedColumns getReferencedColumnsDescriptor() {
082: return referencedColumns;
083: }
084:
085: /**
086: * Does this constraint have a backing index?
087: *
088: * @return boolean Whether or not there is a backing index for this constraint.
089: */
090: public boolean hasBackingIndex() {
091: return false;
092: }
093:
094: /**
095: * Convert the SubCheckConstraintDescriptor to a String.
096: *
097: * @return A String representation of this SubCheckConstraintDescriptor
098: */
099:
100: public String toString() {
101: if (SanityManager.DEBUG) {
102: return "constraintText: " + constraintText + "\n"
103: + super .toString();
104: } else {
105: return "";
106: }
107: }
108:
109: }
|