remove assert looking for new compatibilityMode DOCX
[LibreOffice.git] / offapi / com / sun / star / sdb / DataAccessDescriptor.idl
blobe1cf75c1105304fb587c221323fdfa27d9b34e23
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 module com { module sun { module star { module sdb {
22 /** descriptor for accessing basic data access objects.
24 <p>Various components interacting with the database access world require to specify (or provide themselves) an object
25 such as a query, a table, a result set, a connection to a data source, a column within a table, and so on.<br/>
26 All of these objects are usually not specified with a single property, but with a set of properties, and for
27 various objects, various (but not always different) properties are needed.<br/>
28 The <code>DataAccessDescriptor</code> describes the super set of the properties for the most common
29 data access objects.</p>
31 <p>Every component providing or requiring a DataAccessDescriptor for some functionality
32 is urged to specify which properties are mandatory, and which ones optional. Additionally,
33 it's free to specify any additional requirements about the relations of properties.</p>
35 @since OOo 1.1.2
37 published service DataAccessDescriptor
39 /** specifies the name of the datasource to access.
41 <p>This data source is usually used to create a Connection. If no DataSourceName is given
42 and the #DatabaseLocation and the #ConnectionResource are empty, then an #ActiveConnection
43 is required.</p>
45 @see com::sun::star::sdb::DatabaseContext
46 @see ActiveConnection
48 [optional, property] string DataSourceName;
50 /** specifies the URL of the database file.
52 <p>This database location is usually used to create a Connection. If no DatabaseLocation is given
53 and the #ConnectionResource is empty, then an #ActiveConnection is required.</p>
55 @see com::sun::star::sdb::DatabaseContext
56 @see ActiveConnection
58 [optional, property] string DatabaseLocation;
60 /** specifies the database URL which locates a database driver.
62 <p>This database URL is usually used to create a Connection. If no ConnectionResource is given,
63 then an #ActiveConnection is required.</p>
65 @see com::sun::star::sdb::DatabaseContext
66 @see ActiveConnection
68 [optional, property] string ConnectionResource;
70 /** specifies additional info to use when creating a connection from a <code>ConnectionResource</code>
72 <p>This member is evaluated only when <code>ConnectionResource</code> is used: In this case,
73 com::sun::star::sdbc::XDriverManager::getConnectionWithInfo() is used
74 to create a connection for the given connection resource, instead of
75 com::sun::star::sdbc::XDriverManager::getConnection().</p>
77 <p>If the sequence is empty, it is ignored.</p>
79 [optional, property] sequence< ::com::sun::star::beans::PropertyValue > ConnectionInfo;
81 /** is a connection to use.
83 <p>This object is guaranteed to be a com::sun::star::sdbc::Connection, but usually
84 it will be a Connection from the module com::sun::star::sdb.<br/>
85 Especially in the case where no #DataSourceName is given, but
86 #CommandType is CommandType::QUERY, the ActiveConnection needs
87 to fully support the Connection service, to actually retrieve the query specified by
88 #Command</p>
90 <p>If no ActiveConnection is given, then a #DataSourceName is required.</p>
92 @see DataSourceName
94 [optional, property] com::sun::star::sdbc::XConnection ActiveConnection;
96 /** specifies the command to execute to retrieve a result set.
98 <p>This property is only meaningful together with the #CommandType
99 property, thus either <em>both</em> or <em>none</em> of them are present.</p>
101 @see CommandType
103 [optional, property] string Command;
106 /** specifies the type of the command to be executed to retrieve a result set.
108 <p>#Command needs to be interpreted depending on the value of this property.</p>
110 <p>This property is only meaningful together with the #Command
111 property, thus either <em>both</em> or <em>none</em> of them are present.</p>
113 @see com::sun::star::sdb::CommandType
115 [optional, property] long CommandType;
117 /** specifies an additional filter to optionally use.
119 <p>The Filter string has to form a <code>WHERE</code>-clause, <em>without</em> the
120 <code>WHERE</code>-string itself.</p>
122 <p>If a #DataSourceName, #Command and #CommandType
123 are specified, a RowSet can be created with this information. If the results provided by the
124 row set are to be additionally filtered, the Filter property can be used.</p>
126 <p>Note that the Filter property does not make sense if a #ResultSet has been specified
127 in the DataAccessDescriptor.</p>
129 @see com::sun::star::sdb::RowSet
130 @see ResultSet
132 [optional, property] string Filter;
134 /** specifies an additional <code>ORDER BY</code> clause which should be applied on top of
135 the given #Command.
137 <p>The keyword <code>ORDER BY</code> itself is not part of this property.</p>
139 [optional, property] string Order;
141 /** specifies an additional <code>HAVING</code> clause which should be applied on top of
142 the given #Command.
144 <p>The keyword <code>HAVING</code> itself is not part of this property.</p>
146 [optional, property] string HavingClause;
148 /** specifies an additional <code>GROUP BY</code> clause which should be applied on top of
149 the given #Command.
151 <p>The keyword <code>GROUP BY</code> itself is not part of this property.</p>
153 [optional, property] string GroupBy;
155 /** specifies if the #Command should be analyzed on the client side before sending it
156 to the database server.
158 <p>The default value of this property is `TRUE`. By switching it to `FALSE`, you can pass
159 backend-specific SQL statements, which are not standard SQL, to your database.</p>
161 <p>This property is usually present together with the #Command and
162 #CommandType properties, and is evaluated if and only if #CommandType
163 equals CommandType::COMMAND.</p>
165 [optional, property] boolean EscapeProcessing;
167 /** specifies an already existent result set to use.
169 <p>Usually, you use the properties #DataSourceName (alternatively
170 #ActiveConnection), #Command and #CommandType to specify
171 how to <em>obtain</em> a result set. However, in scenarios where the provider of a DataAccessDescriptor
172 has access to an already existent result set, it can pass it along for reusage. This is encouraged
173 to increase performance.</p>
175 <p>The object will at least support the com::sun::star::sdbc::ResultSet service.</p>
177 <p>Note that any superservices of com::sun::star::sdbc::ResultSet
178 are also allowed. Especially, this member can denote an instance of the
179 com::sun::star::sdb::RowSet, or an instance obtained
180 by calling com::sun::star::sdb::XResultSetAccess::createResultSet()
181 on such a com::sun::star::sdb::RowSet. This becomes important in
182 conjunction with the #Selection property.</p>
184 @see com::sun::star::sdb::XResultSetAccess
186 [optional, property] com::sun::star::sdbc::XResultSet ResultSet;
188 /** specifies a selection to confine the records in a result set.
190 <p>When you specify a result set either implicitly (#DataSourceName, #Command,
191 #CommandType) or explicitly (#ResultSet), the set of results can be
192 additionally refined with this property.</p>
194 <p>The single elements of the #Selection are either record numbers (see
195 com::sun::star::sdbc::XResultSet::getRow()), or bookmarks (see
196 com::sun::star::sdbcx::XRowLocate::getBookmark()).<br/>
197 It is up to the component which provides or requires a DataAccessDescriptor to specify which of the
198 two alternatives it expects. If it does <em>not</em> specify this, then the property
199 #BookmarkSelection becomes mandatory.</p>
201 <p>If the elements specify bookmarks, and a #ResultSet has been specified, then
202 this result set is required to support the com::sun::star::sdbcx::XRowLocate interface.</p>
204 [optional, property] sequence< any > Selection;
206 /** specifies how to interpret #Selection
208 <p>If present, #BookmarkSelection specifies the semantics of #Selection. If
209 not present, it's up to the implementing component to specify this semantics.</p>
211 <p>If `TRUE`, then the single elements of the array specified by #Selection are
212 bookmarks relative to the result set, if `FALSE`, they're record numbers.</p>
214 @see com::sun::star::sdbcx::XRowLocate
215 @see com::sun::star::sdbc::XResultSet
216 @see com::sun::star::sdb::XResultSetAccess
218 [optional, property] boolean BookmarkSelection;
220 /** specifies a column name.
222 <p>This property is usually used together with the #Command and
223 #CommandType properties.</p>
225 @see Column
227 [optional, property] string ColumnName;
229 /** specifies a column object
231 <p>For reasons of performance and saving resources, a supplier of an DataAccessDescriptor which is
232 used to describe a column object can pass this object directly, instead of specifying it only implicitly
233 with the #ColumnName property.</p>
235 <p>The object will at least support the com::sun::star::sdbcx::Column service, but more
236 often it will even be a Column from the com::sun::star::sdb module.</p>
238 [optional, property] com::sun::star::beans::XPropertySet Column;
241 }; }; }; };
243 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */