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: XSQLQueryComposer.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 ************************************************************************/
30 #ifndef __com_sun_star_sdb_XSQLQueryComposer_idl__
31 #define __com_sun_star_sdb_XSQLQueryComposer_idl__
33 #ifndef __com_sun_star_beans_XPropertySet_idl__
34 #include
<com
/sun
/star
/beans
/XPropertySet.idl
>
37 #ifndef __com_sun_star_beans_PropertyValue_idl__
38 #include
<com
/sun
/star
/beans
/PropertyValue.idl
>
41 #ifndef __com_sun_star_sdbc_SQLException_idl__
42 #include
<com
/sun
/star
/sdbc
/SQLException.idl
>
45 //=============================================================================
47 module com
{ module sun
{ module star
{ module sdb
{
49 //=============================================================================
51 /** should be provided by a tool which simplifies the handling with SQL select statements.
54 The interface can be used for composing SELECT statements without knowing the
55 structure of the used query.
58 published
interface XSQLQueryComposer
: com
::sun
::star
::uno
::XInterface
61 /** returns the query used for composing.
66 //-------------------------------------------------------------------------
68 /** sets a new query for the composer, which may be expanded by filters
72 @throws com::sun::star::sdbc::SQLException
73 if a database access error occurs.
75 void setQuery
([in] string command
)
76 raises
(com
::sun
::star
::sdbc
::SQLException
);
77 //-------------------------------------------------------------------------
79 /** returns the query composed with filters and sort criterias.
83 string getComposedQuery
();
84 //-------------------------------------------------------------------------
86 /** returns the currently used filter.
89 The filter criteria returned is part of the where condition of the
90 select command, but it does not contain the where token.
96 //-------------------------------------------------------------------------
98 /** returns the currently used filter.
100 The filter criteria is split into levels. Each level represents the
101 OR criterias. Within each level, the filters are provided as an AND criteria
102 with the name of the column and the filter condition. The filter condition
106 the structured filter
108 sequence
< sequence
<com
::sun
::star
::beans
::PropertyValue
> >
109 getStructuredFilter
();
110 //-------------------------------------------------------------------------
112 /** returns the currently used sort order.
116 The order criteria returned is part of the ORDER BY clause of the
117 select command, but it does not contain the ORDER BY keyword .
123 //-------------------------------------------------------------------------
125 /** appends a new filter condition by a
126 <type scope="com::sun::star::sdb">DataColumn</type>
127 providing the name and the value for the filter.
129 the column which is used to create a filter
130 @throws com::sun::star::sdbc::SQLException
131 if a database access error occurs.
133 void appendFilterByColumn
([in] com
::sun
::star
::beans
::XPropertySet column
)
134 raises
(com
::sun
::star
::sdbc
::SQLException
);
135 //-------------------------------------------------------------------------
137 /** appends an additional part to the sort order criteria of the select
140 the column which is used to create a order part
142 <TRUE/> when the order should be ascending, otherwise <FALSE/>
143 @throws com::sun::star::sdbc::SQLException
144 if a database access error occurs.
146 void appendOrderByColumn
([in] com
::sun
::star
::beans
::XPropertySet column
,
147 [in] boolean ascending
)
148 raises
(com
::sun
::star
::sdbc
::SQLException
);
149 //-------------------------------------------------------------------------
151 /** makes it possible to set a filter condition for the query.
154 @throws com::sun::star::sdbc::SQLException
155 if a database access error occurs.
157 void setFilter
([in] string filter
)
158 raises
(com
::sun
::star
::sdbc
::SQLException
);
159 //-------------------------------------------------------------------------
161 /** makes it possibile to set a sort condition for the query.
163 the order part to set
164 @throws com::sun::star::sdbc::SQLException
165 if a database access error occurs.
167 void setOrder
([in] string order
)
168 raises
(com
::sun
::star
::sdbc
::SQLException
);
171 //=============================================================================
175 /*=============================================================================
177 =============================================================================*/