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