1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef __com_sun_star_sdbc_KeyRule_idl__
20 #define __com_sun_star_sdbc_KeyRule_idl__
22 module com
{ module sun
{ module star
{ module sdbc
{
25 /** determines the rules for foreign key constraints.
27 published constants KeyRule
30 /** a possible value for the column's
31 <code>UPDATE_RULE</code>
33 <code>DELETE_RULE</code>
35 com::sun::star::sdbc::XResultSet
36 objects returned by the methods
37 com::sun::star::sdbc::XDatabaseMetaData::getImportedKeys(),
38 com::sun::star::sdbc::XDatabaseMetaData::getExportedKeys(),
39 and com::sun::star::sdbc::XDatabaseMetaData::getCrossReference().
42 <code>UPDATE_RULE</code>
45 when the primary key is updated, the foreign key (imported key)
46 is changed to agree with it.
50 <code>DELETE_RULE</code>
53 when the primary key is deleted, rows that imported that key
57 const long CASCADE
= 0;
59 /** a possible value for the column's
60 <code>UPDATE_RULE</code>
62 <code>DELETE_RULE</code>
64 com::sun::star::sdbc::XResultSet
65 objects returned by the methods
66 com::sun::star::sdbc::XDatabaseMetaData::getImportedKeys(),
67 com::sun::star::sdbc::XDatabaseMetaData::getExportedKeys(),
68 and com::sun::star::sdbc::XDatabaseMetaData::getCrossReference().
71 <code>UPDATE_RULE</code>
73 a primary key may not be updated if it has been imported by
74 another table as a foreign key.
78 <code>DELETE_RULE</code>
80 a primary key may not be deleted if it has been imported by
81 another table as a foreign key.
84 const long RESTRICT
= 1;
86 /** a possible value for the column's
87 <code>UPDATE_RULE</code>
89 <code>DELETE_RULE</code>
91 com::sun::star::sdbc::XResultSet
92 objects returned by the methods
93 com::sun::star::sdbc::XDatabaseMetaData::getImportedKeys(),
94 com::sun::star::sdbc::XDatabaseMetaData::getExportedKeys(),
95 and com::sun::star::sdbc::XDatabaseMetaData::getCrossReference().
98 <code>UPDATE_RULE</code>
100 <code>DELETE_RULE</code>
103 when the primary key is updated or deleted, the foreign key (imported key)
104 is changed to <code>NULL</code>.
107 const long SET_NULL
= 2;
109 /** a possible value for the column's
110 <code>UPDATE_RULE</code>
112 <code>DELETE_RULE</code>
114 com::sun::star::sdbc::XResultSet
115 objects returned by the methods
116 com::sun::star::sdbc::XDatabaseMetaData::getImportedKeys(),
117 com::sun::star::sdbc::XDatabaseMetaData::getExportedKeys(),
118 and com::sun::star::sdbc::XDatabaseMetaData::getCrossReference().
121 <code>UPDATE_RULE</code>
123 <code>DELETE_RULE</code>
125 it indicates that if the primary key has been imported, it cannot be updated or deleted.
128 const long NO_ACTION
= 3;
130 /** a possible value for the column's
131 <code>UPDATE_RULE</code>
133 <code>DELETE_RULE</code>
135 com::sun::star::sdbc::XResultSet
136 objects returned by the methods
137 com::sun::star::sdbc::XDatabaseMetaData::getImportedKeys(),
138 com::sun::star::sdbc::XDatabaseMetaData::getExportedKeys(),
139 and com::sun::star::sdbc::XDatabaseMetaData::getCrossReference().
142 <code>UPDATE_RULE</code>
144 <code>DELETE_RULE</code>
147 if the primary key is updated or deleted, the foreign key (imported key)
148 is set to the default value.
151 const long SET_DEFAULT
= 4;
157 /*===========================================================================
158 ===========================================================================*/
161 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */