KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2
3    Derby - Class org.apache.derby.iapi.sql.dictionary.SubCheckConstraintDescriptor
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
25 import org.apache.derby.catalog.ReferencedColumns;
26 import org.apache.derby.catalog.UUID;
27
28 import org.apache.derby.iapi.services.sanity.SanityManager;
29 /**
30  * This interface is used to get information from a SubCheckConstraintDescriptor.
31  * A SubCheckConstraintDescriptor is used within the DataDictionary to
32  * get auxiliary constraint information from the system table
33  * that is auxiliary to sysconstraints.
34  *
35  * @version 0.1
36  * @author Jerry Brenner
37  */

38
39 public class SubCheckConstraintDescriptor extends SubConstraintDescriptor
40 {
41     /** public interface to this class:
42         <ol>
43         <li>public String getConstraintText();</li>
44         <li>public ReferencedColumns getReferencedColumnsDescriptor();</li>
45         </ol>
46     */

47
48     // Implementation
49
private ReferencedColumns referencedColumns;
50     private String JavaDoc constraintText;
51
52     /**
53      * Constructor for a SubCheckConstraintDescriptor
54      *
55      * @param constraintId The UUID of the constraint.
56      * @param constraintText The text of the constraint definition.
57      * @param referencedColumns The columns referenced by the check constraint
58      */

59
60     public SubCheckConstraintDescriptor(UUID constraintId, String JavaDoc constraintText,
61                                      ReferencedColumns referencedColumns)
62     {
63         super(constraintId);
64         this.constraintText = constraintText;
65         this.referencedColumns = referencedColumns;
66     }
67
68     /**
69      * Get the text of the check constraint definition.
70      *
71      * @return The text of the check constraint definition.
72      */

73     public String JavaDoc getConstraintText()
74     {
75         return constraintText;
76     }
77
78     /**
79      * Get the ReferencedColumns.
80      *
81      * @return The ReferencedColumns.
82      */

83     public ReferencedColumns getReferencedColumnsDescriptor()
84     {
85         return referencedColumns;
86     }
87
88     /**
89      * Does this constraint have a backing index?
90      *
91      * @return boolean Whether or not there is a backing index for this constraint.
92      */

93     public boolean hasBackingIndex()
94     {
95         return false;
96     }
97
98     /**
99      * Convert the SubCheckConstraintDescriptor to a String.
100      *
101      * @return A String representation of this SubCheckConstraintDescriptor
102      */

103
104     public String JavaDoc toString()
105     {
106         if (SanityManager.DEBUG)
107         {
108             return "constraintText: " + constraintText + "\n" +
109                 super.toString();
110         }
111         else
112         {
113             return "";
114         }
115     }
116
117 }
118
Popular Tags