xref: /AOO41X/main/offapi/com/sun/star/sdb/XSQLQueryComposer.idl (revision d1766043198e81d0bcfc626e12893e7b4d7e31ca)
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
10cdf0e10cSrcweir *
11*d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir *
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.
19cdf0e10cSrcweir *
20*d1766043SAndrew Rist *************************************************************/
21*d1766043SAndrew Rist
22*d1766043SAndrew Rist
23cdf0e10cSrcweir#ifndef __com_sun_star_sdb_XSQLQueryComposer_idl__
24cdf0e10cSrcweir#define __com_sun_star_sdb_XSQLQueryComposer_idl__
25cdf0e10cSrcweir
26cdf0e10cSrcweir#ifndef __com_sun_star_beans_XPropertySet_idl__
27cdf0e10cSrcweir#include <com/sun/star/beans/XPropertySet.idl>
28cdf0e10cSrcweir#endif
29cdf0e10cSrcweir
30cdf0e10cSrcweir#ifndef __com_sun_star_beans_PropertyValue_idl__
31cdf0e10cSrcweir#include <com/sun/star/beans/PropertyValue.idl>
32cdf0e10cSrcweir#endif
33cdf0e10cSrcweir
34cdf0e10cSrcweir#ifndef __com_sun_star_sdbc_SQLException_idl__
35cdf0e10cSrcweir#include <com/sun/star/sdbc/SQLException.idl>
36cdf0e10cSrcweir#endif
37cdf0e10cSrcweir
38cdf0e10cSrcweir//=============================================================================
39cdf0e10cSrcweir
40cdf0e10cSrcweir module com {  module sun {  module star {  module sdb {
41cdf0e10cSrcweir
42cdf0e10cSrcweir//=============================================================================
43cdf0e10cSrcweir
44cdf0e10cSrcweir/** should be provided by a tool which simplifies the handling with SQL select statements.
45cdf0e10cSrcweir
46cdf0e10cSrcweir	<p>
47cdf0e10cSrcweir	The interface can be used for composing SELECT statements without knowing the
48cdf0e10cSrcweir	structure of the used query.
49cdf0e10cSrcweir	</p>
50cdf0e10cSrcweir */
51cdf0e10cSrcweirpublished interface XSQLQueryComposer: com::sun::star::uno::XInterface
52cdf0e10cSrcweir{
53cdf0e10cSrcweir
54cdf0e10cSrcweir	/** returns the query used for composing.
55cdf0e10cSrcweir		@returns
56cdf0e10cSrcweir			the query
57cdf0e10cSrcweir	 */
58cdf0e10cSrcweir	string getQuery();
59cdf0e10cSrcweir	//-------------------------------------------------------------------------
60cdf0e10cSrcweir
61cdf0e10cSrcweir	/** sets a new query for the composer, which may be expanded by filters
62cdf0e10cSrcweir		and sort criteria.
63cdf0e10cSrcweir		@param command
64cdf0e10cSrcweir			the command to set
65cdf0e10cSrcweir		@throws com::sun::star::sdbc::SQLException
66cdf0e10cSrcweir			if a database access error occurs.
67cdf0e10cSrcweir	 */
68cdf0e10cSrcweir	void setQuery([in] string command )
69cdf0e10cSrcweir			raises (com::sun::star::sdbc::SQLException);
70cdf0e10cSrcweir	//-------------------------------------------------------------------------
71cdf0e10cSrcweir
72cdf0e10cSrcweir	/** returns the query composed with filters and sort criterias.
73cdf0e10cSrcweir		@returns
74cdf0e10cSrcweir			the composed query
75cdf0e10cSrcweir	 */
76cdf0e10cSrcweir	string getComposedQuery();
77cdf0e10cSrcweir	//-------------------------------------------------------------------------
78cdf0e10cSrcweir
79cdf0e10cSrcweir	/** returns the currently used filter.
80cdf0e10cSrcweir
81cdf0e10cSrcweir		<p>
82cdf0e10cSrcweir		The filter criteria returned is part of the where condition of the
83cdf0e10cSrcweir		select command, but it does not contain the where token.
84cdf0e10cSrcweir		</p>
85cdf0e10cSrcweir		@returns
86cdf0e10cSrcweir			the filter
87cdf0e10cSrcweir	 */
88cdf0e10cSrcweir	string getFilter();
89cdf0e10cSrcweir	//-------------------------------------------------------------------------
90cdf0e10cSrcweir
91cdf0e10cSrcweir	/** returns the currently used filter.
92cdf0e10cSrcweir			 <p>
93cdf0e10cSrcweir			 The filter criteria is split into levels. Each level represents the
94cdf0e10cSrcweir			 OR criterias. Within each level, the filters are provided as an AND criteria
95cdf0e10cSrcweir			 with the name of the column and the filter condition. The filter condition
96cdf0e10cSrcweir			 is of type string.
97cdf0e10cSrcweir			 </p>
98cdf0e10cSrcweir		@returns
99cdf0e10cSrcweir			the structured filter
100cdf0e10cSrcweir	 */
101cdf0e10cSrcweir	sequence< sequence<com::sun::star::beans::PropertyValue> >
102cdf0e10cSrcweir		getStructuredFilter();
103cdf0e10cSrcweir	//-------------------------------------------------------------------------
104cdf0e10cSrcweir
105cdf0e10cSrcweir	/** returns the currently used sort order.
106cdf0e10cSrcweir
107cdf0e10cSrcweir
108cdf0e10cSrcweir		<p>
109cdf0e10cSrcweir		The order criteria returned is part of the ORDER BY clause of the
110cdf0e10cSrcweir		select command, but it does not contain the ORDER BY keyword .
111cdf0e10cSrcweir		</p>
112cdf0e10cSrcweir		@returns
113cdf0e10cSrcweir			the order
114cdf0e10cSrcweir	 */
115cdf0e10cSrcweir	string getOrder();
116cdf0e10cSrcweir	//-------------------------------------------------------------------------
117cdf0e10cSrcweir
118cdf0e10cSrcweir	/** appends a new filter condition by a
119cdf0e10cSrcweir		<type scope="com::sun::star::sdb">DataColumn</type>
120cdf0e10cSrcweir		providing the name and the value for the filter.
121cdf0e10cSrcweir		@param column
122cdf0e10cSrcweir			the column which is used to create a filter
123cdf0e10cSrcweir		@throws com::sun::star::sdbc::SQLException
124cdf0e10cSrcweir			if a database access error occurs.
125cdf0e10cSrcweir	 */
126cdf0e10cSrcweir	void appendFilterByColumn([in] com::sun::star::beans::XPropertySet column)
127cdf0e10cSrcweir			raises (com::sun::star::sdbc::SQLException);
128cdf0e10cSrcweir	//-------------------------------------------------------------------------
129cdf0e10cSrcweir
130cdf0e10cSrcweir	/** appends an additional part to the sort order criteria of the select
131cdf0e10cSrcweir		statement.
132cdf0e10cSrcweir		@param column
133cdf0e10cSrcweir			the column which is used to create a order part
134cdf0e10cSrcweir		@param	ascending
135cdf0e10cSrcweir			<TRUE/> when the order should be ascending, otherwise <FALSE/>
136cdf0e10cSrcweir		@throws com::sun::star::sdbc::SQLException
137cdf0e10cSrcweir			if a database access error occurs.
138cdf0e10cSrcweir	 */
139cdf0e10cSrcweir	void appendOrderByColumn([in] com::sun::star::beans::XPropertySet column,
140cdf0e10cSrcweir			 				 [in] boolean ascending)
141cdf0e10cSrcweir			raises (com::sun::star::sdbc::SQLException);
142cdf0e10cSrcweir	//-------------------------------------------------------------------------
143cdf0e10cSrcweir
144cdf0e10cSrcweir	/** makes it possible to set a filter condition	for the query.
145cdf0e10cSrcweir		@param filter
146cdf0e10cSrcweir			the filter to set
147cdf0e10cSrcweir		@throws com::sun::star::sdbc::SQLException
148cdf0e10cSrcweir			if a database access error occurs.
149cdf0e10cSrcweir	 */
150cdf0e10cSrcweir	void setFilter([in] string filter)
151cdf0e10cSrcweir			raises (com::sun::star::sdbc::SQLException);
152cdf0e10cSrcweir	//-------------------------------------------------------------------------
153cdf0e10cSrcweir
154cdf0e10cSrcweir	/** makes it possibile to set a sort condition for the query.
155cdf0e10cSrcweir		@param order
156cdf0e10cSrcweir			the order part to set
157cdf0e10cSrcweir		@throws com::sun::star::sdbc::SQLException
158cdf0e10cSrcweir			if a database access error occurs.
159cdf0e10cSrcweir	 */
160cdf0e10cSrcweir	void setOrder([in] string order)
161cdf0e10cSrcweir			raises (com::sun::star::sdbc::SQLException);
162cdf0e10cSrcweir};
163cdf0e10cSrcweir
164cdf0e10cSrcweir//=============================================================================
165cdf0e10cSrcweir
166cdf0e10cSrcweir}; }; }; };
167cdf0e10cSrcweir
168cdf0e10cSrcweir/*=============================================================================
169cdf0e10cSrcweir
170cdf0e10cSrcweir=============================================================================*/
171cdf0e10cSrcweir#endif
172