1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef __com_sun_star_sdbc_KeyRule_idl__
28 #define __com_sun_star_sdbc_KeyRule_idl__
30 module com
{ module sun
{ module star
{ module sdbc
{
33 /** determines the rules for foreign key constraints.
35 published constants KeyRule
38 /** a possible value for the column's
39 <code>UPDATE_RULE</code>
41 <code>DELETE_RULE</code>
43 <type scope="com::sun::star::sdbc">XResultSet</type>
44 objects returned by the methods
45 <member scope="com::sun::star::sdbc">XDatabaseMetaData::getImportedKeys()</member>
47 <member scope="com::sun::star::sdbc">XDatabaseMetaData::getExportedKeys()</member>
50 <member scope="com::sun::star::sdbc">XDatabaseMetaData::getCrossReference()</member>
54 <code>UPDATE_RULE</code>
57 when the primary key is updated, the foreign key (imported key)
58 is changed to agree with it.
62 <code>DELETE_RULE</code>
65 when the primary key is deleted, rows that imported that key
69 const long CASCADE
= 0;
70 //-------------------------------------------------------------------------
72 /** a possible value for the column's
73 <code>UPDATE_RULE</code>
75 <code>DELETE_RULE</code>
77 <type scope="com::sun::star::sdbc">XResultSet</type>
78 objects returned by the methods
79 <member scope="com::sun::star::sdbc">XDatabaseMetaData::getImportedKeys()</member>
81 <member scope="com::sun::star::sdbc">XDatabaseMetaData::getExportedKeys()</member>
84 <member scope="com::sun::star::sdbc">XDatabaseMetaData::getCrossReference()</member>
88 <code>UPDATE_RULE</code>
90 a primary key may not be updated if it has been imported by
91 another table as a foreign key.
95 <code>DELETE_RULE</code>
97 a primary key may not be deleted if it has been imported by
98 another table as a foreign key.
101 const long RESTRICT
= 1;
102 //-------------------------------------------------------------------------
104 /** a possible value for the column's
105 <code>UPDATE_RULE</code>
107 <code>DELETE_RULE</code>
109 <type scope="com::sun::star::sdbc">XResultSet</type>
110 objects returned by the methods
111 <member scope="com::sun::star::sdbc">XDatabaseMetaData::getImportedKeys()</member>
113 <member scope="com::sun::star::sdbc">XDatabaseMetaData::getExportedKeys()</member>
116 <member scope="com::sun::star::sdbc">XDatabaseMetaData::getCrossReference()</member>
120 <code>UPDATE_RULE</code>
122 <code>DELETE_RULE</code>
125 when the primary key is updated or deleted, the foreign key (imported key)
126 is changed to <code>NULL</code>.
129 const long SET_NULL
= 2;
130 //-------------------------------------------------------------------------
132 /** a possible value for the column's
133 <code>UPDATE_RULE</code>
135 <code>DELETE_RULE</code>
137 <type scope="com::sun::star::sdbc">XResultSet</type>
138 objects returned by the methods
139 <member scope="com::sun::star::sdbc">XDatabaseMetaData::getImportedKeys()</member>
141 <member scope="com::sun::star::sdbc">XDatabaseMetaData::getExportedKeys()</member>
144 <member scope="com::sun::star::sdbc">XDatabaseMetaData::getCrossReference()</member>
148 <code>UPDATE_RULE</code>
150 <code>DELETE_RULE</code>
152 it indicates that if the primary key has been imported, it cannot be updated or deleted.
155 const long NO_ACTION
= 3;
156 //-------------------------------------------------------------------------
158 /** a possible value for the column's
159 <code>UPDATE_RULE</code>
161 <code>DELETE_RULE</code>
163 <type scope="com::sun::star::sdbc">XResultSet</type>
164 objects returned by the methods
165 <member scope="com::sun::star::sdbc">XDatabaseMetaData::getImportedKeys()</member>
167 <member scope="com::sun::star::sdbc">XDatabaseMetaData::getExportedKeys()</member>
170 <member scope="com::sun::star::sdbc">XDatabaseMetaData::getCrossReference()</member>
174 <code>UPDATE_RULE</code>
176 <code>DELETE_RULE</code>
179 if the primary key is updated or deleted, the foreign key (imported key)
180 is set to the default value.
183 const long SET_DEFAULT
= 4;
186 //=============================================================================
190 /*===========================================================================
191 ===========================================================================*/