1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: DataAccessDescriptor.idl,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef __com_sun_star_sdb_DataAccessDescriptor_idl__
32 #define __com_sun_star_sdb_DataAccessDescriptor_idl__
34 #ifndef __com_sun_star_sdbc_Connection_idl__
35 #include
<com
/sun
/star
/sdbc
/Connection.idl
>
38 #ifndef __com_sun_star_sdbc_ResultSet_idl__
39 #include
<com
/sun
/star
/sdbc
/ResultSet.idl
>
42 #ifndef __com_sun_star_beans_XPropertySet_idl__
43 #include
<com
/sun
/star
/beans
/XPropertySet.idl
>
46 #ifndef __com_sun_star_beans_PropertyValue_idl__
47 #include
<com
/sun
/star
/beans
/PropertyValue.idl
>
50 module com
{ module sun
{ module star
{ module sdb
{
52 /** descriptor for accessing basic data access objects.
54 <p>Various components interacting with the database access world require to specify (or provide themself) an object
55 such as a query, a table, a result set, a connection to a data source, a column within a table, and so on.</br>
56 All of these objects are usually not specified with a single property, but with a set of properties, and for
57 various objects, various (but not always different) properties are needed.<br/>
58 The <code>DataAccessDescriptor</code> describes the super set of the properties for the most common
59 data access objects.</p>
61 <p>Every component providing or requiring a <type>DataAccessDescriptor</type> for some functionality
62 is urged to specify which properties are mandatory, and which ones optional. Additionally,
63 it's free to specify any additional requirements about the relations of properties.</p>
67 published service DataAccessDescriptor
69 /** specifies the name of the datasource to access.
71 <p>This data source is usually used to create a <type>Connection</type>. If no DataSourceName is given
72 and the <member>DatabaseLocation</member> and the <member>ConnectionResource</member> are emtpy, then an <member>ActiveConnection</member>
75 @see com::sun::star::sdb::DatabaseContext
78 [optional, property
] string DataSourceName
;
80 /** specifies the URL of the database file.
82 <p>This database location is usually used to create a <type>Connection</type>. If no DatabaseLocation is given
83 and the <member>ConnectionResource</member> is emtpy, then an <member>ActiveConnection</member> is reuqired.</p>
85 @see com::sun::star::sdb::DatabaseContext
88 [optional, property
] string DatabaseLocation
;
90 /** specifies the database URL which locates a database driver.
92 <p>This database URL is usually used to create a <type>Connection</type>. If no ConnectionResource is given,
93 then an <member>ActiveConnection</member> is reuqired.</p>
95 @see com::sun::star::sdb::DatabaseContext
98 [optional, property
] string ConnectionResource
;
100 /** specifies additional info to use when creating a connection from a <code>ConnectionResource</code>
102 <p>This member is evaluated only when <code>ConnectionResource</code> is used: In this case,
103 <member scope="com::sun::star::sdbc">XDriverManager::getConnectionWithInfo</member> is used
104 to create a connection for the given connection resource, instead of
105 <member scope="com::sun::star::sdbc">XDriverManager::getConnection</member>.</p>
107 <p>If the sequence is empty, it is ignored.</p>
109 [optional, property
] sequence
< ::com
::sun
::star
::beans
::PropertyValue
> ConnectionInfo
;
111 /** is a connection to use.
113 <p>This object is guaranteed to be a <type scope="com::sun::star::sdbc">Connection</type>, but usually
114 it will be a <type>Connection</type> from the module com::sun::star::sdb.<br/>
115 Especially in the case where no <member>DataSourceName</member> is given, but
116 <member>CommandType</member> is <member>CommandType::QUERY</member>, the ActiveConnection needs
117 to fully support the <type>Connection</type> service, to actually retrieve the query specified by
118 <member>Command</member></p>
120 <p>If no ActiveConnection is given, then a <member>DataSourceName</member> is required.</p>
124 [optional, property
] com
::sun
::star
::sdbc
::XConnection ActiveConnection
;
126 /** specifies the command to execute to retrieve a result set.
128 <p>This property is only meaningful together with the <member>CommandType</member>
129 property, thus either <em>both</em> or <em>none</em> of them are present.</p>
133 [optional, property
] string Command
;
136 /** specifies the type of the command to be executed to retrieve a result set.
138 <p><member>Command</member> needs to be interpreted depending on the value of this property.</p>
140 <p>This property is only meaningfull together with the <member>Command</member>
141 property, thus either <em>both</em> or <em>none</em> of them are present.</p>
143 @see com::sun::star::sdb::CommandType
145 [optional, property
] long CommandType
;
147 /** specifies an addtional filter to optionally use.
149 <p>The Filter string has to form a <code>WHERE</code>-clause, <em>without</em> the
150 <code>WHERE</code>-string itself.</p>
152 <p>If a <member>DataSourceName</member>, <member>Command</member> and <member>CommandType</member>
153 are specified, a <type>RowSet</type> can be created with this information. If the results provided by the
154 row set are to be additionally filtered, the Filter property can be used.</p>
156 <p>Note that the Filter property does not make sense if a <member>ResultSet</member> has been specified
157 in the DataAccessDescriptor.</p>
159 @see com::sun::star::sdb::RowSet
162 [optional, property
] string Filter
;
164 /** specifies an additional <code>ORDER BY</code> clause which should be applied on top of
165 the given <member>Command</member>.
167 <p>The keyword <code>ORDER BY</code> itself is not part of this property.</p>
169 [optional, property
] string Order
;
171 /** specifies an additional <code>HAVING</code> clause which should be applied on top of
172 the given <member>Command</member>.
174 <p>The keyword <code>HAVING</code> itself is not part of this property.</p>
176 [optional, property
] string HavingClause
;
178 /** specifies an additional <code>GROUP BY</code> clause which should be applied on top of
179 the given <member>Command</member>.
181 <p>The keyword <code>GROUP BY</code> itself is not part of this property.</p>
183 [optional, property
] string GroupBy
;
185 /** specifies if the <member>Command</member> should be analyzed on the client side before sending it
186 to the database server.
188 <p>The default value of this property is <TRUE/>. By switching it to <FALSE/>, you can pass
189 backend-specific SQL statements, which are not standard SQL, to your database.</p>
191 <p>This property is usually present together with the <member>Command</member> and
192 <member>CommandType</member> properties, and is evaluated if and only if <member>CommandType</member>
193 equals <member>CommandType::COMMAND</member>.</p>
195 [optional, property
] boolean EscapeProcessing
;
197 /** specifies an already existent result set to use.
199 <p>Usually, you use the properties <member>DataSourceName</member> (alternatively
200 <member>ActiveConnection</member>), <member>Command</member> and <member>CommandType</member> to specify
201 how to <em>obtain</em> a result set. However, in scenarious where the provider of a DataAccessDescriptor
202 has access to an already existent result set, it can pass it along for reusage. This is encouraged
203 to increase performance.</p>
205 <p>The object will at least support the <type scope="com::sun::star::sdbc">ResultSet</type>.</p>
207 <p>Note that any superservices of <type scope="com::sun::star::sdbc">ResultSet</type>
208 are also allowed. Especially, this member can denote an instance of the
209 <type scope="com::sun::star::sdb">RowSet</type>, or an instance obtained
210 by calling <member scope="com::sun::star::sdb">XResultSetAccess::createResultSet</member>
211 on such a <type scope="com::sun::star::sdb">RowSet</type>. This becomes important in
212 conjunction with the <member>Selection</member> property.</p>
214 @see com::sun::star::sdb::XResultSetAccess
216 [optional, property
] com
::sun
::star
::sdbc
::XResultSet ResultSet
;
218 /** specifies a selection to confine the records in a result set.
220 <p>When you specify a result set either implicitly (<member>DataSourceName</member>, <member>Command</member>,
221 <member>CommandType</member>) or explicitly (<member>ResultSet</member>), the set of results can be
222 additionally refined with this property.</p>
224 <p>The single elements of the <member>Selection</member> are either record numbers (see
225 <member scope="com::sun::star::sdbc">XResultSet::getRow</member>), or bookmarks (see
226 <member scope="com::sun::star::sdbcx">XRowLocate::getBookmark</member>).<br/>
227 It is up to the component which provides or requires a DataAccessDescriptor to specify which of the
228 two alternatives it expects. If it does <em>not</em> specify this, then the property
229 <member>BookmarkSelection</member> becomes mandatory.</p>
231 <p>If the elements specify bookmarks, and a <member>ResultSet</member> has been specified, then
232 this result set is required to support the <type scope="com::sun::star::sdbcx">XRowLocate</type> interface.</p>
234 [optional, property
] sequence
< any
> Selection
;
236 /** specifies how to interpret <member>Selection</member>
238 <p>If present, <member>BookmarkSelection</member> specifies the semantics of <member>Selection</member>. If
239 not present, it's up to the implementing component to specify this semantics.</p>
241 <p>If <TRUE/>, then the single elements of the array specified by <member>Selection</member> are
242 bookmarks relative to the result set, if <FALSE/>, they're record numbers.</p>
244 @see com::sun::star::sdbcx::XRowLocate
245 @see com::sun::star::sdbc::XResultSet
246 @see com::sun::star::sdb::XResultSetAccess
248 [optional, property
] boolean BookmarkSelection
;
250 /** specifies a column name.
252 <p>This property is usually used together with the <member>Command</member> and
253 <member>CommandType</member> properties.</p>
257 [optional, property
] string ColumnName
;
259 /** specifies a column object
261 <p>For reasons of performance and saving resources, a supplier of an DataAccessDescriptor which is
262 used to describe a column object can pass this object directly, instead of specifying it only implicitly
263 with the <member>ColumnName</member> property.</p>
265 <p>The object will at least support the <type scope="com::sun::star::sdbcx">Column</type> service, but more
266 often it will even be a <type>Column</type> from the com::sun::star::sdb module.</p>
268 [optional, property
] com
::sun
::star
::beans
::XPropertySet Column
;