xref: /aoo41x/main/offapi/com/sun/star/sdbc/XArray.idl (revision d1766043)
1*d1766043SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3*d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5*d1766043SAndrew Rist * distributed with this work for additional information
6*d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7*d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9*d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10*d1766043SAndrew Rist *
11*d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12*d1766043SAndrew Rist *
13*d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*d1766043SAndrew Rist * software distributed under the License is distributed on an
15*d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17*d1766043SAndrew Rist * specific language governing permissions and limitations
18*d1766043SAndrew Rist * under the License.
19*d1766043SAndrew Rist *
20*d1766043SAndrew Rist *************************************************************/
21*d1766043SAndrew Rist
22*d1766043SAndrew Rist
23cdf0e10cSrcweir#ifndef __com_sun_star_sdbc_XArray_idl__
24cdf0e10cSrcweir#define __com_sun_star_sdbc_XArray_idl__
25cdf0e10cSrcweir
26cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__
27cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl>
28cdf0e10cSrcweir#endif
29cdf0e10cSrcweir
30cdf0e10cSrcweir module com {  module sun {  module star {  module container {
31cdf0e10cSrcweir published interface XNameAccess;
32cdf0e10cSrcweir};};};};
33cdf0e10cSrcweir
34cdf0e10cSrcweir#ifndef __com_sun_star_sdbc_SQLException_idl__
35cdf0e10cSrcweir#include <com/sun/star/sdbc/SQLException.idl>
36cdf0e10cSrcweir#endif
37cdf0e10cSrcweir
38cdf0e10cSrcweir module com {  module sun {  module star {  module sdbc {
39cdf0e10cSrcweir
40cdf0e10cSrcweir published interface XResultSet;
41cdf0e10cSrcweir
42cdf0e10cSrcweir
43cdf0e10cSrcweir/** is used for mapping the SQL type
44cdf0e10cSrcweir	<member scope= "com::sun::star::sdbc">DataType::ARRAY</member>
45cdf0e10cSrcweir	.
46cdf0e10cSrcweir	By default, an
47cdf0e10cSrcweir	<code>Array</code>
48cdf0e10cSrcweir	is a transaction duration
49cdf0e10cSrcweir	reference to an SQL array. By default, an
50cdf0e10cSrcweir
51cdf0e10cSrcweir	<code>Array</code>
52cdf0e10cSrcweir
53cdf0e10cSrcweir	is implemented using a SQL LOCATOR(array) internally.
54cdf0e10cSrcweir */
55cdf0e10cSrcweirpublished interface XArray: com::sun::star::uno::XInterface
56cdf0e10cSrcweir{
57cdf0e10cSrcweir
58cdf0e10cSrcweir	/** returns the SQL type name of the elements in
59cdf0e10cSrcweir		the array designated by this
60cdf0e10cSrcweir		<code>Array</code>
61cdf0e10cSrcweir		object.
62cdf0e10cSrcweir		<p>
63cdf0e10cSrcweir		If the elements are a built-in type, it returns
64cdf0e10cSrcweir		the database-specific type name of the elements.
65cdf0e10cSrcweir		If the elements are a user-defined type (UDT),
66cdf0e10cSrcweir		this method returns the fully-qualified SQL type name.
67cdf0e10cSrcweir		</p>
68cdf0e10cSrcweir		@returns
69cdf0e10cSrcweir			a String that is the database-specific name for a built-in base type or the fully-qualified SQL type name for a base type that is a UDT
70cdf0e10cSrcweir
71cdf0e10cSrcweir		@throws SQLException
72cdf0e10cSrcweir			if a database access error occurs.
73cdf0e10cSrcweir	 */
74cdf0e10cSrcweir	string getBaseTypeName() raises (SQLException);
75cdf0e10cSrcweir
76cdf0e10cSrcweir  	//-------------------------------------------------------------------------
77cdf0e10cSrcweir
78cdf0e10cSrcweir	/** returns the SDBC type of the elements in the array designated
79cdf0e10cSrcweir		by this
80cdf0e10cSrcweir		<code>Array</code>
81cdf0e10cSrcweir		object.
82cdf0e10cSrcweir		@returns
83cdf0e10cSrcweir			a constant from the SDBC types that is the type code for the elements in the array designated by this Array object.
84cdf0e10cSrcweir		@throws SQLException
85cdf0e10cSrcweir			if a database access error occurs.
86cdf0e10cSrcweir	 */
87cdf0e10cSrcweir	long getBaseType() raises (SQLException);
88cdf0e10cSrcweir
89cdf0e10cSrcweir	//-------------------------------------------------------------------------
90cdf0e10cSrcweir
91cdf0e10cSrcweir	/** retrieves the contents of the SQL array designated by this
92cdf0e10cSrcweir		   	 <code>Array</code>
93cdf0e10cSrcweir			 object, using the specified
94cdf0e10cSrcweir			 <code>typeMap</code>
95cdf0e10cSrcweir			 for type map customizations.
96cdf0e10cSrcweir			 <p>
97cdf0e10cSrcweir			 If the base type of the array does not match a user-defined type
98cdf0e10cSrcweir			 in
99cdf0e10cSrcweir			 <code>typeMap</code>
100cdf0e10cSrcweir			 , the standard mapping is used instead.
101cdf0e10cSrcweir
102cdf0e10cSrcweir		     @param typeMap
103cdf0e10cSrcweir				is a map object that contains mappings of SQL type names to
104cdf0e10cSrcweir				services. If the
105cdf0e10cSrcweir				<code>typeMap</code>
106cdf0e10cSrcweir				is
107cdf0e10cSrcweir				<NULL/>
108cdf0e10cSrcweir				, the type-map
109cdf0e10cSrcweir		   	 	associated with the connection for customizations of the type-mappings
110cdf0e10cSrcweir			 	is used.
111cdf0e10cSrcweir
112cdf0e10cSrcweir			 @returns
113cdf0e10cSrcweir				an sequence that contains the ordered elements
114cdf0e10cSrcweir				of the SQL array designated by this object.
115cdf0e10cSrcweir
116cdf0e10cSrcweir		     @throws SQLException
117cdf0e10cSrcweir				if an error occurs while attempting to access the array.
118cdf0e10cSrcweir	 */
119cdf0e10cSrcweir	sequence<any> getArray([in]com::sun::star::container::XNameAccess typeMap)
120cdf0e10cSrcweir		raises (SQLException);
121cdf0e10cSrcweir
122cdf0e10cSrcweir  	//-------------------------------------------------------------------------
123cdf0e10cSrcweir
124cdf0e10cSrcweir	/** returns an array containing a slice of the SQL array, beginning with the
125cdf0e10cSrcweir		   	 specified
126cdf0e10cSrcweir			 <code>index</code>
127cdf0e10cSrcweir			 and containing up to
128cdf0e10cSrcweir			 <code>count</code>
129cdf0e10cSrcweir		   	 successive elements of the SQL array.
130cdf0e10cSrcweir
131cdf0e10cSrcweir			 @param index
132cdf0e10cSrcweir				is the array index of the first element to retrieve;
133cdf0e10cSrcweir		        the first element is at index 1.
134cdf0e10cSrcweir		   	 @param count
135cdf0e10cSrcweir				is the number of successive SQL array elements to retrieve.
136cdf0e10cSrcweir			 @param typeMap
137cdf0e10cSrcweir				is a map object that contains mappings of SQL type names to
138cdf0e10cSrcweir				services. If the
139cdf0e10cSrcweir				<code>typeMap</code>
140cdf0e10cSrcweir				is
141cdf0e10cSrcweir				<NULL/>
142cdf0e10cSrcweir				, the type-map
143cdf0e10cSrcweir		   	    associated with the connection for customizations of the type-mappings
144cdf0e10cSrcweir				is used.
145cdf0e10cSrcweir		     @returns
146cdf0e10cSrcweir				an array containing up to
147cdf0e10cSrcweir				<code>count</code>
148cdf0e10cSrcweir				consecutive elements
149cdf0e10cSrcweir		   		of the SQL array, beginning with element
150cdf0e10cSrcweir				<code>index</code>
151cdf0e10cSrcweir				.
152cdf0e10cSrcweir		   	 @throws SQLException
153cdf0e10cSrcweir				if an error occurs while attempting to access the array.
154cdf0e10cSrcweir	 */
155cdf0e10cSrcweir	sequence<any> getArrayAtIndex([in]long index,
156cdf0e10cSrcweir								  [in]long count,
157cdf0e10cSrcweir								  [in]com::sun::star::container::XNameAccess
158cdf0e10cSrcweir								  									typeMap)
159cdf0e10cSrcweir			raises (SQLException);
160cdf0e10cSrcweir
161cdf0e10cSrcweir  	//-------------------------------------------------------------------------
162cdf0e10cSrcweir
163cdf0e10cSrcweir	/** returns a result set that contains the elements of the array
164cdf0e10cSrcweir		designated by this
165cdf0e10cSrcweir		<code>Array</code>
166cdf0e10cSrcweir		object and uses the given
167cdf0e10cSrcweir		<code>typeMap</code>
168cdf0e10cSrcweir		to map the array elements.  If the base
169cdf0e10cSrcweir		type of the array does not match a user-defined type in
170cdf0e10cSrcweir		<code>typeMap</code>
171cdf0e10cSrcweir		or the
172cdf0e10cSrcweir		<code>typeMap</code>
173cdf0e10cSrcweir		is
174cdf0e10cSrcweir		<NULL/>
175cdf0e10cSrcweir		,
176cdf0e10cSrcweir		the connection type mapping is used instead.
177cdf0e10cSrcweir
178cdf0e10cSrcweir
179cdf0e10cSrcweir		<p>
180cdf0e10cSrcweir		The result set contains one row for each array element, with
181cdf0e10cSrcweir		two columns in each row.  The second column stores the element
182cdf0e10cSrcweir		value; the first column stores the index into the array for
183cdf0e10cSrcweir		that element (with the first array element being at index 1).
184cdf0e10cSrcweir		The rows are in ascending order corresponding to
185cdf0e10cSrcweir		the order of the indices.
186cdf0e10cSrcweir		</p>
187cdf0e10cSrcweir
188cdf0e10cSrcweir		@param	typeMap
189cdf0e10cSrcweir			contains mapping of SQL user-defined types to classes in the UNO programming language
190cdf0e10cSrcweir		@returns
191cdf0e10cSrcweir			a ResultSet object containing one row for each of the elements in the array designated by this Array object,
192cdf0e10cSrcweir			with the rows in ascending order based on the indices.
193cdf0e10cSrcweir		@throws SQLException
194cdf0e10cSrcweir			if a database access error occurs.
195cdf0e10cSrcweir	 */
196cdf0e10cSrcweir	XResultSet getResultSet([in]com::sun::star::container::XNameAccess typeMap)
197cdf0e10cSrcweir		raises (SQLException);
198cdf0e10cSrcweir
199cdf0e10cSrcweir  	//-------------------------------------------------------------------------
200cdf0e10cSrcweir
201cdf0e10cSrcweir	/** returns a result set holding the elements of the subarray that
202cdf0e10cSrcweir		starts at index
203cdf0e10cSrcweir		<code>index</code>
204cdf0e10cSrcweir		and contains up to
205cdf0e10cSrcweir		<code>count</code>
206cdf0e10cSrcweir		successive elements. This method uses the given
207cdf0e10cSrcweir		<code>typeMap</code>
208cdf0e10cSrcweir		to map the array elements. If the base
209cdf0e10cSrcweir		type of the array does not match a user-defined type in
210cdf0e10cSrcweir		<code>typeMap</code>
211cdf0e10cSrcweir		or the
212cdf0e10cSrcweir		<code>typeMap</code>
213cdf0e10cSrcweir		is
214cdf0e10cSrcweir		<NULL/>
215cdf0e10cSrcweir		,
216cdf0e10cSrcweir		the connection type mapping is used instead.
217cdf0e10cSrcweir
218cdf0e10cSrcweir
219cdf0e10cSrcweir		<p>
220cdf0e10cSrcweir		The result set contains one row for each array element, with
221cdf0e10cSrcweir		two columns in each row.  The second column stores the element
222cdf0e10cSrcweir		value; the first column stores the index into the array for
223cdf0e10cSrcweir		that element (with the first array element being at index 1).
224cdf0e10cSrcweir		The rows are in ascending order corresponding to
225cdf0e10cSrcweir		the order of the indices.
226cdf0e10cSrcweir		</p>
227cdf0e10cSrcweir		@param index
228cdf0e10cSrcweir			the array index of the first element to retrieve; the first element is at index 1.
229cdf0e10cSrcweir		@param count
230cdf0e10cSrcweir			the number of successive SQL array elements to retrieve,
231cdf0e10cSrcweir		@param typeMap
232cdf0e10cSrcweir			the Map object that contains the mapping of SQL type names to classes in the UNO programming language.
233cdf0e10cSrcweir		@returns
234cdf0e10cSrcweir			a ResultSet object containing up to count consecutive elements of the SQL array
235cdf0e10cSrcweir			designated by this Array object, starting at index index.
236cdf0e10cSrcweir		@throws SQLException
237cdf0e10cSrcweir			if a database access error occurs.
238cdf0e10cSrcweir	 */
239cdf0e10cSrcweir	XResultSet getResultSetAtIndex([in]long index,
240cdf0e10cSrcweir								   [in]long count,
241cdf0e10cSrcweir								   [in]com::sun::star::container::XNameAccess typeMap)
242cdf0e10cSrcweir		raises (SQLException);
243cdf0e10cSrcweir};
244cdf0e10cSrcweir
245cdf0e10cSrcweir//=============================================================================
246cdf0e10cSrcweir
247cdf0e10cSrcweir}; }; }; };
248cdf0e10cSrcweir
249cdf0e10cSrcweir/*===========================================================================
250cdf0e10cSrcweir===========================================================================*/
251cdf0e10cSrcweir#endif
252