xref: /aoo4110/main/offapi/com/sun/star/sdbc/KeyRule.idl (revision b1cdbd2c)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  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,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#ifndef __com_sun_star_sdbc_KeyRule_idl__
24#define __com_sun_star_sdbc_KeyRule_idl__
25
26 module com {  module sun {  module star {  module sdbc {
27
28
29/** determines the rules for foreign key constraints.
30 */
31published constants KeyRule
32{
33
34	/** a possible value for the column's
35			<code>UPDATE_RULE</code>
36			and
37			<code>DELETE_RULE</code>
38			in the
39			<type scope="com::sun::star::sdbc">XResultSet</type>
40			 objects returned by the methods
41			 <member  scope="com::sun::star::sdbc">XDatabaseMetaData::getImportedKeys()</member>
42			 ,
43			 <member  scope="com::sun::star::sdbc">XDatabaseMetaData::getExportedKeys()</member>
44			 ,
45			 and
46			 <member  scope="com::sun::star::sdbc">XDatabaseMetaData::getCrossReference()</member>
47			 .
48			 <P>
49			 For the column
50			 <code>UPDATE_RULE</code>
51			 ,
52			 it indicates that
53			 when the primary key is updated, the foreign key (imported key)
54			 is changed to agree with it.
55			 </P>
56			 <P>
57			 For the column
58			 <code>DELETE_RULE</code>
59			,
60			 it indicates that
61			 when the primary key is deleted, rows that imported that key
62			 are deleted.
63			 </P>
64	 */
65	const long CASCADE	= 0;
66	//-------------------------------------------------------------------------
67
68	/** a possible value for the column's
69			 <code>UPDATE_RULE</code>
70			 and
71			 <code>DELETE_RULE</code>
72			in the
73			 <type scope="com::sun::star::sdbc">XResultSet</type>
74			 objects returned by the methods
75			 <member  scope="com::sun::star::sdbc">XDatabaseMetaData::getImportedKeys()</member>
76			 ,
77			 <member  scope="com::sun::star::sdbc">XDatabaseMetaData::getExportedKeys()</member>
78			 ,
79			 and
80			 <member  scope="com::sun::star::sdbc">XDatabaseMetaData::getCrossReference()</member>
81			 .
82			 <P>
83			 For the column
84			 <code>UPDATE_RULE</code>
85			, it indicates that
86			 a primary key may not be updated if it has been imported by
87			 another table as a foreign key.
88			 </P>
89			 <P>
90			 For the column
91			 <code>DELETE_RULE</code>
92			, it indicates that
93			 a primary key may not be deleted if it has been imported by
94			 another table as a foreign key.
95			 </P>
96	 */
97	const long RESTRICT = 1;
98	//-------------------------------------------------------------------------
99
100	/** a possible value for the column's
101			 <code>UPDATE_RULE</code>
102			 and
103			 <code>DELETE_RULE</code>
104			in the
105			 <type scope="com::sun::star::sdbc">XResultSet</type>
106			  objects returned by the methods
107			<member  scope="com::sun::star::sdbc">XDatabaseMetaData::getImportedKeys()</member>
108			 ,
109			 <member  scope="com::sun::star::sdbc">XDatabaseMetaData::getExportedKeys()</member>
110			 ,
111			 and
112			 <member  scope="com::sun::star::sdbc">XDatabaseMetaData::getCrossReference()</member>
113			 .
114			 <P>
115			 For the columns
116			 <code>UPDATE_RULE</code>
117			 and
118			 <code>DELETE_RULE</code>
119			,
120			 it indicates that
121			 when the primary key is updated or deleted, the foreign key (imported key)
122			 is changed to <code>NULL</code>.
123			 </P>
124	 */
125	const long SET_NULL  = 2;
126	//-------------------------------------------------------------------------
127
128	/** a possible value for the column's
129			<code>UPDATE_RULE</code>
130			 and
131			 <code>DELETE_RULE</code>
132			 in the
133			 <type scope="com::sun::star::sdbc">XResultSet</type>
134			 objects returned by the methods
135			 <member  scope="com::sun::star::sdbc">XDatabaseMetaData::getImportedKeys()</member>
136			 ,
137			 <member  scope="com::sun::star::sdbc">XDatabaseMetaData::getExportedKeys()</member>
138			 ,
139			 and
140			 <member  scope="com::sun::star::sdbc">XDatabaseMetaData::getCrossReference()</member>
141			 .
142			 <P>
143			 For the columns
144			 <code>UPDATE_RULE</code>
145			 and
146			 <code>DELETE_RULE</code>
147			,
148			 it indicates that if the primary key has been imported, it cannot be updated or deleted.
149			 </P>
150	 */
151	const long NO_ACTION = 3;
152	//-------------------------------------------------------------------------
153
154	/** a possible value for the column's
155			<code>UPDATE_RULE</code>
156			 and
157			 <code>DELETE_RULE</code>
158			in the
159			 <type scope="com::sun::star::sdbc">XResultSet</type>
160			 objects returned by the methods
161			 <member  scope="com::sun::star::sdbc">XDatabaseMetaData::getImportedKeys()</member>
162			 ,
163			 <member  scope="com::sun::star::sdbc">XDatabaseMetaData::getExportedKeys()</member>
164			 ,
165			 and
166			 <member  scope="com::sun::star::sdbc">XDatabaseMetaData::getCrossReference()</member>
167			 .
168			 <P>
169			 For the columns
170			 <code>UPDATE_RULE</code>
171			 and
172			 <code>DELETE_RULE</code>
173			,
174			 it indicates that
175			 if the primary key is updated or deleted, the foreign key (imported key)
176			 is set to the default value.
177			 </P>
178	 */
179	const long SET_DEFAULT  = 4;
180};
181
182//=============================================================================
183
184}; }; }; };
185
186/*===========================================================================
187===========================================================================*/
188#endif
189