1/************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 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. 14 * 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). 20 * 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. 25 * 26 ************************************************************************/ 27#ifndef __com_sun_star_sdbc_KeyRule_idl__ 28#define __com_sun_star_sdbc_KeyRule_idl__ 29 30 module com { module sun { module star { module sdbc { 31 32 33/** determines the rules for foreign key constraints. 34 */ 35published constants KeyRule 36{ 37 38 /** a possible value for the column's 39 <code>UPDATE_RULE</code> 40 and 41 <code>DELETE_RULE</code> 42 in the 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> 46 , 47 <member scope="com::sun::star::sdbc">XDatabaseMetaData::getExportedKeys()</member> 48 , 49 and 50 <member scope="com::sun::star::sdbc">XDatabaseMetaData::getCrossReference()</member> 51 . 52 <P> 53 For the column 54 <code>UPDATE_RULE</code> 55 , 56 it indicates that 57 when the primary key is updated, the foreign key (imported key) 58 is changed to agree with it. 59 </P> 60 <P> 61 For the column 62 <code>DELETE_RULE</code> 63 , 64 it indicates that 65 when the primary key is deleted, rows that imported that key 66 are deleted. 67 </P> 68 */ 69 const long CASCADE = 0; 70 //------------------------------------------------------------------------- 71 72 /** a possible value for the column's 73 <code>UPDATE_RULE</code> 74 and 75 <code>DELETE_RULE</code> 76 in the 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> 80 , 81 <member scope="com::sun::star::sdbc">XDatabaseMetaData::getExportedKeys()</member> 82 , 83 and 84 <member scope="com::sun::star::sdbc">XDatabaseMetaData::getCrossReference()</member> 85 . 86 <P> 87 For the column 88 <code>UPDATE_RULE</code> 89 , it indicates that 90 a primary key may not be updated if it has been imported by 91 another table as a foreign key. 92 </P> 93 <P> 94 For the column 95 <code>DELETE_RULE</code> 96 , it indicates that 97 a primary key may not be deleted if it has been imported by 98 another table as a foreign key. 99 </P> 100 */ 101 const long RESTRICT = 1; 102 //------------------------------------------------------------------------- 103 104 /** a possible value for the column's 105 <code>UPDATE_RULE</code> 106 and 107 <code>DELETE_RULE</code> 108 in the 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> 112 , 113 <member scope="com::sun::star::sdbc">XDatabaseMetaData::getExportedKeys()</member> 114 , 115 and 116 <member scope="com::sun::star::sdbc">XDatabaseMetaData::getCrossReference()</member> 117 . 118 <P> 119 For the columns 120 <code>UPDATE_RULE</code> 121 and 122 <code>DELETE_RULE</code> 123 , 124 it indicates that 125 when the primary key is updated or deleted, the foreign key (imported key) 126 is changed to <code>NULL</code>. 127 </P> 128 */ 129 const long SET_NULL = 2; 130 //------------------------------------------------------------------------- 131 132 /** a possible value for the column's 133 <code>UPDATE_RULE</code> 134 and 135 <code>DELETE_RULE</code> 136 in the 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> 140 , 141 <member scope="com::sun::star::sdbc">XDatabaseMetaData::getExportedKeys()</member> 142 , 143 and 144 <member scope="com::sun::star::sdbc">XDatabaseMetaData::getCrossReference()</member> 145 . 146 <P> 147 For the columns 148 <code>UPDATE_RULE</code> 149 and 150 <code>DELETE_RULE</code> 151 , 152 it indicates that if the primary key has been imported, it cannot be updated or deleted. 153 </P> 154 */ 155 const long NO_ACTION = 3; 156 //------------------------------------------------------------------------- 157 158 /** a possible value for the column's 159 <code>UPDATE_RULE</code> 160 and 161 <code>DELETE_RULE</code> 162 in the 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> 166 , 167 <member scope="com::sun::star::sdbc">XDatabaseMetaData::getExportedKeys()</member> 168 , 169 and 170 <member scope="com::sun::star::sdbc">XDatabaseMetaData::getCrossReference()</member> 171 . 172 <P> 173 For the columns 174 <code>UPDATE_RULE</code> 175 and 176 <code>DELETE_RULE</code> 177 , 178 it indicates that 179 if the primary key is updated or deleted, the foreign key (imported key) 180 is set to the default value. 181 </P> 182 */ 183 const long SET_DEFAULT = 4; 184}; 185 186//============================================================================= 187 188}; }; }; }; 189 190/*=========================================================================== 191===========================================================================*/ 192#endif 193