merged tag ooo/OOO330_m14
[LibreOffice.git] / offapi / com / sun / star / sdb / DataAccessDescriptor.idl
blob10f9432b498b5199b2df2c61553fcaced7111a0a
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 ************************************************************************/
28 #ifndef __com_sun_star_sdb_DataAccessDescriptor_idl__
29 #define __com_sun_star_sdb_DataAccessDescriptor_idl__
31 #ifndef __com_sun_star_sdbc_Connection_idl__
32 #include <com/sun/star/sdbc/Connection.idl>
33 #endif
35 #ifndef __com_sun_star_sdbc_ResultSet_idl__
36 #include <com/sun/star/sdbc/ResultSet.idl>
37 #endif
39 #ifndef __com_sun_star_beans_XPropertySet_idl__
40 #include <com/sun/star/beans/XPropertySet.idl>
41 #endif
43 #ifndef __com_sun_star_beans_PropertyValue_idl__
44 #include <com/sun/star/beans/PropertyValue.idl>
45 #endif
47 module com { module sun { module star { module sdb {
49 /** descriptor for accessing basic data access objects.
51 <p>Various components interacting with the database access world require to specify (or provide themself) an object
52 such as a query, a table, a result set, a connection to a data source, a column within a table, and so on.<br/>
53 All of these objects are usually not specified with a single property, but with a set of properties, and for
54 various objects, various (but not always different) properties are needed.<br/>
55 The <code>DataAccessDescriptor</code> describes the super set of the properties for the most common
56 data access objects.</p>
58 <p>Every component providing or requiring a <type>DataAccessDescriptor</type> for some functionality
59 is urged to specify which properties are mandatory, and which ones optional. Additionally,
60 it's free to specify any additional requirements about the relations of properties.</p>
62 @since OOo 1.1.2
64 published service DataAccessDescriptor
66 /** specifies the name of the datasource to access.
68 <p>This data source is usually used to create a <type>Connection</type>. If no DataSourceName is given
69 and the <member>DatabaseLocation</member> and the <member>ConnectionResource</member> are emtpy, then an <member>ActiveConnection</member>
70 is required.</p>
72 @see com::sun::star::sdb::DatabaseContext
73 @see ActiveConnection
75 [optional, property] string DataSourceName;
77 /** specifies the URL of the database file.
79 <p>This database location is usually used to create a <type>Connection</type>. If no DatabaseLocation is given
80 and the <member>ConnectionResource</member> is emtpy, then an <member>ActiveConnection</member> is reuqired.</p>
82 @see com::sun::star::sdb::DatabaseContext
83 @see ActiveConnection
85 [optional, property] string DatabaseLocation;
87 /** specifies the database URL which locates a database driver.
89 <p>This database URL is usually used to create a <type>Connection</type>. If no ConnectionResource is given,
90 then an <member>ActiveConnection</member> is reuqired.</p>
92 @see com::sun::star::sdb::DatabaseContext
93 @see ActiveConnection
95 [optional, property] string ConnectionResource;
97 /** specifies additional info to use when creating a connection from a <code>ConnectionResource</code>
99 <p>This member is evaluated only when <code>ConnectionResource</code> is used: In this case,
100 <member scope="com::sun::star::sdbc">XDriverManager::getConnectionWithInfo</member> is used
101 to create a connection for the given connection resource, instead of
102 <member scope="com::sun::star::sdbc">XDriverManager::getConnection</member>.</p>
104 <p>If the sequence is empty, it is ignored.</p>
106 [optional, property] sequence< ::com::sun::star::beans::PropertyValue > ConnectionInfo;
108 /** is a connection to use.
110 <p>This object is guaranteed to be a <type scope="com::sun::star::sdbc">Connection</type>, but usually
111 it will be a <type>Connection</type> from the module com::sun::star::sdb.<br/>
112 Especially in the case where no <member>DataSourceName</member> is given, but
113 <member>CommandType</member> is <member>CommandType::QUERY</member>, the ActiveConnection needs
114 to fully support the <type>Connection</type> service, to actually retrieve the query specified by
115 <member>Command</member></p>
117 <p>If no ActiveConnection is given, then a <member>DataSourceName</member> is required.</p>
119 @see DataSourceName
121 [optional, property] com::sun::star::sdbc::XConnection ActiveConnection;
123 /** specifies the command to execute to retrieve a result set.
125 <p>This property is only meaningful together with the <member>CommandType</member>
126 property, thus either <em>both</em> or <em>none</em> of them are present.</p>
128 @see CommandType
130 [optional, property] string Command;
133 /** specifies the type of the command to be executed to retrieve a result set.
135 <p><member>Command</member> needs to be interpreted depending on the value of this property.</p>
137 <p>This property is only meaningfull together with the <member>Command</member>
138 property, thus either <em>both</em> or <em>none</em> of them are present.</p>
140 @see com::sun::star::sdb::CommandType
142 [optional, property] long CommandType;
144 /** specifies an addtional filter to optionally use.
146 <p>The Filter string has to form a <code>WHERE</code>-clause, <em>without</em> the
147 <code>WHERE</code>-string itself.</p>
149 <p>If a <member>DataSourceName</member>, <member>Command</member> and <member>CommandType</member>
150 are specified, a <type>RowSet</type> can be created with this information. If the results provided by the
151 row set are to be additionally filtered, the Filter property can be used.</p>
153 <p>Note that the Filter property does not make sense if a <member>ResultSet</member> has been specified
154 in the DataAccessDescriptor.</p>
156 @see com::sun::star::sdb::RowSet
157 @see ResultSet
159 [optional, property] string Filter;
161 /** specifies an additional <code>ORDER BY</code> clause which should be applied on top of
162 the given <member>Command</member>.
164 <p>The keyword <code>ORDER BY</code> itself is not part of this property.</p>
166 [optional, property] string Order;
168 /** specifies an additional <code>HAVING</code> clause which should be applied on top of
169 the given <member>Command</member>.
171 <p>The keyword <code>HAVING</code> itself is not part of this property.</p>
173 [optional, property] string HavingClause;
175 /** specifies an additional <code>GROUP BY</code> clause which should be applied on top of
176 the given <member>Command</member>.
178 <p>The keyword <code>GROUP BY</code> itself is not part of this property.</p>
180 [optional, property] string GroupBy;
182 /** specifies if the <member>Command</member> should be analyzed on the client side before sending it
183 to the database server.
185 <p>The default value of this property is <TRUE/>. By switching it to <FALSE/>, you can pass
186 backend-specific SQL statements, which are not standard SQL, to your database.</p>
188 <p>This property is usually present together with the <member>Command</member> and
189 <member>CommandType</member> properties, and is evaluated if and only if <member>CommandType</member>
190 equals <member>CommandType::COMMAND</member>.</p>
192 [optional, property] boolean EscapeProcessing;
194 /** specifies an already existent result set to use.
196 <p>Usually, you use the properties <member>DataSourceName</member> (alternatively
197 <member>ActiveConnection</member>), <member>Command</member> and <member>CommandType</member> to specify
198 how to <em>obtain</em> a result set. However, in scenarious where the provider of a DataAccessDescriptor
199 has access to an already existent result set, it can pass it along for reusage. This is encouraged
200 to increase performance.</p>
202 <p>The object will at least support the <type scope="com::sun::star::sdbc">ResultSet</type> service.</p>
204 <p>Note that any superservices of <type scope="com::sun::star::sdbc">ResultSet</type>
205 are also allowed. Especially, this member can denote an instance of the
206 <type scope="com::sun::star::sdb">RowSet</type>, or an instance obtained
207 by calling <member scope="com::sun::star::sdb">XResultSetAccess::createResultSet</member>
208 on such a <type scope="com::sun::star::sdb">RowSet</type>. This becomes important in
209 conjunction with the <member>Selection</member> property.</p>
211 @see com::sun::star::sdb::XResultSetAccess
213 [optional, property] com::sun::star::sdbc::XResultSet ResultSet;
215 /** specifies a selection to confine the records in a result set.
217 <p>When you specify a result set either implicitly (<member>DataSourceName</member>, <member>Command</member>,
218 <member>CommandType</member>) or explicitly (<member>ResultSet</member>), the set of results can be
219 additionally refined with this property.</p>
221 <p>The single elements of the <member>Selection</member> are either record numbers (see
222 <member scope="com::sun::star::sdbc">XResultSet::getRow</member>), or bookmarks (see
223 <member scope="com::sun::star::sdbcx">XRowLocate::getBookmark</member>).<br/>
224 It is up to the component which provides or requires a DataAccessDescriptor to specify which of the
225 two alternatives it expects. If it does <em>not</em> specify this, then the property
226 <member>BookmarkSelection</member> becomes mandatory.</p>
228 <p>If the elements specify bookmarks, and a <member>ResultSet</member> has been specified, then
229 this result set is required to support the <type scope="com::sun::star::sdbcx">XRowLocate</type> interface.</p>
231 [optional, property] sequence< any > Selection;
233 /** specifies how to interpret <member>Selection</member>
235 <p>If present, <member>BookmarkSelection</member> specifies the semantics of <member>Selection</member>. If
236 not present, it's up to the implementing component to specify this semantics.</p>
238 <p>If <TRUE/>, then the single elements of the array specified by <member>Selection</member> are
239 bookmarks relative to the result set, if <FALSE/>, they're record numbers.</p>
241 @see com::sun::star::sdbcx::XRowLocate
242 @see com::sun::star::sdbc::XResultSet
243 @see com::sun::star::sdb::XResultSetAccess
245 [optional, property] boolean BookmarkSelection;
247 /** specifies a column name.
249 <p>This property is usually used together with the <member>Command</member> and
250 <member>CommandType</member> properties.</p>
252 @see Column
254 [optional, property] string ColumnName;
256 /** specifies a column object
258 <p>For reasons of performance and saving resources, a supplier of an DataAccessDescriptor which is
259 used to describe a column object can pass this object directly, instead of specifying it only implicitly
260 with the <member>ColumnName</member> property.</p>
262 <p>The object will at least support the <type scope="com::sun::star::sdbcx">Column</type> service, but more
263 often it will even be a <type>Column</type> from the com::sun::star::sdb module.</p>
265 [optional, property] com::sun::star::beans::XPropertySet Column;
268 }; }; }; };
270 #endif