1 | /* |
2 | |
3 | Derby - Class org.apache.derby.iapi.sql.dictionary.SubCheckConstraintDescriptor |
4 | |
5 | Copyright 1998, 2004 The Apache Software Foundation or its licensors, as applicable. |
6 | |
7 | Licensed under the Apache License, Version 2.0 (the "License"); |
8 | you may not use this file except in compliance with the License. |
9 | You may obtain a copy of the License at |
10 | |
11 | http://www.apache.org/licenses/LICENSE-2.0 |
12 | |
13 | Unless required by applicable law or agreed to in writing, software |
14 | distributed under the License is distributed on an "AS IS" BASIS, |
15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
16 | See the License for the specific language governing permissions and |
17 | limitations under the License. |
18 | |
19 | */ |
20 | |
21 | package org.apache.derby.iapi.sql.dictionary; |
22 | |
23 | |
24 | import org.apache.derby.catalog.ReferencedColumns; |
25 | import org.apache.derby.catalog.UUID; |
26 | |
27 | import org.apache.derby.iapi.services.sanity.SanityManager; |
28 | /** |
29 | * This interface is used to get information from a SubCheckConstraintDescriptor. |
30 | * A SubCheckConstraintDescriptor is used within the DataDictionary to |
31 | * get auxiliary constraint information from the system table |
32 | * that is auxiliary to sysconstraints. |
33 | * |
34 | * @version 0.1 |
35 | * @author Jerry Brenner |
36 | */ |
37 | |
38 | public class SubCheckConstraintDescriptor extends SubConstraintDescriptor |
39 | { |
40 | /** public interface to this class: |
41 | <ol> |
42 | <li>public String getConstraintText();</li> |
43 | <li>public ReferencedColumns getReferencedColumnsDescriptor();</li> |
44 | </ol> |
45 | */ |
46 | |
47 | // Implementation |
48 | private ReferencedColumns referencedColumns; |
49 | private String constraintText; |
50 | |
51 | /** |
52 | * Constructor for a SubCheckConstraintDescriptor |
53 | * |
54 | * @param constraintId The UUID of the constraint. |
55 | * @param constraintText The text of the constraint definition. |
56 | * @param referencedColumns The columns referenced by the check constraint |
57 | */ |
58 | |
59 | public SubCheckConstraintDescriptor(UUID constraintId, String constraintText, |
60 | ReferencedColumns referencedColumns) |
61 | { |
62 | super(constraintId); |
63 | this.constraintText = constraintText; |
64 | this.referencedColumns = referencedColumns; |
65 | } |
66 | |
67 | /** |
68 | * Get the text of the check constraint definition. |
69 | * |
70 | * @return The text of the check constraint definition. |
71 | */ |
72 | public String getConstraintText() |
73 | { |
74 | return constraintText; |
75 | } |
76 | |
77 | /** |
78 | * Get the ReferencedColumns. |
79 | * |
80 | * @return The ReferencedColumns. |
81 | */ |
82 | public ReferencedColumns getReferencedColumnsDescriptor() |
83 | { |
84 | return referencedColumns; |
85 | } |
86 | |
87 | /** |
88 | * Does this constraint have a backing index? |
89 | * |
90 | * @return boolean Whether or not there is a backing index for this constraint. |
91 | */ |
92 | public boolean hasBackingIndex() |
93 | { |
94 | return false; |
95 | } |
96 | |
97 | /** |
98 | * Convert the SubCheckConstraintDescriptor to a String. |
99 | * |
100 | * @return A String representation of this SubCheckConstraintDescriptor |
101 | */ |
102 | |
103 | public String toString() |
104 | { |
105 | if (SanityManager.DEBUG) |
106 | { |
107 | return "constraintText: " + constraintText + "\n" + |
108 | super.toString(); |
109 | } |
110 | else |
111 | { |
112 | return ""; |
113 | } |
114 | } |
115 | |
116 | } |