1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef __com_sun_star_sdb_XSQLQueryComposer_idl__
28 #define __com_sun_star_sdb_XSQLQueryComposer_idl__
30 #ifndef __com_sun_star_beans_XPropertySet_idl__
31 #include
<com
/sun
/star
/beans
/XPropertySet.idl
>
34 #ifndef __com_sun_star_beans_PropertyValue_idl__
35 #include
<com
/sun
/star
/beans
/PropertyValue.idl
>
38 #ifndef __com_sun_star_sdbc_SQLException_idl__
39 #include
<com
/sun
/star
/sdbc
/SQLException.idl
>
42 //=============================================================================
44 module com
{ module sun
{ module star
{ module sdb
{
46 //=============================================================================
48 /** should be provided by a tool which simplifies the handling with SQL select statements.
51 The interface can be used for composing SELECT statements without knowing the
52 structure of the used query.
55 published
interface XSQLQueryComposer
: com
::sun
::star
::uno
::XInterface
58 /** returns the query used for composing.
63 //-------------------------------------------------------------------------
65 /** sets a new query for the composer, which may be expanded by filters
69 @throws com::sun::star::sdbc::SQLException
70 if a database access error occurs.
72 void setQuery
([in] string command
)
73 raises
(com
::sun
::star
::sdbc
::SQLException
);
74 //-------------------------------------------------------------------------
76 /** returns the query composed with filters and sort criterias.
80 string getComposedQuery
();
81 //-------------------------------------------------------------------------
83 /** returns the currently used filter.
86 The filter criteria returned is part of the where condition of the
87 select command, but it does not contain the where token.
93 //-------------------------------------------------------------------------
95 /** returns the currently used filter.
97 The filter criteria is split into levels. Each level represents the
98 OR criterias. Within each level, the filters are provided as an AND criteria
99 with the name of the column and the filter condition. The filter condition
103 the structured filter
105 sequence
< sequence
<com
::sun
::star
::beans
::PropertyValue
> >
106 getStructuredFilter
();
107 //-------------------------------------------------------------------------
109 /** returns the currently used sort order.
113 The order criteria returned is part of the ORDER BY clause of the
114 select command, but it does not contain the ORDER BY keyword .
120 //-------------------------------------------------------------------------
122 /** appends a new filter condition by a
123 <type scope="com::sun::star::sdb">DataColumn</type>
124 providing the name and the value for the filter.
126 the column which is used to create a filter
127 @throws com::sun::star::sdbc::SQLException
128 if a database access error occurs.
130 void appendFilterByColumn
([in] com
::sun
::star
::beans
::XPropertySet column
)
131 raises
(com
::sun
::star
::sdbc
::SQLException
);
132 //-------------------------------------------------------------------------
134 /** appends an additional part to the sort order criteria of the select
137 the column which is used to create a order part
139 <TRUE/> when the order should be ascending, otherwise <FALSE/>
140 @throws com::sun::star::sdbc::SQLException
141 if a database access error occurs.
143 void appendOrderByColumn
([in] com
::sun
::star
::beans
::XPropertySet column
,
144 [in] boolean ascending
)
145 raises
(com
::sun
::star
::sdbc
::SQLException
);
146 //-------------------------------------------------------------------------
148 /** makes it possible to set a filter condition for the query.
151 @throws com::sun::star::sdbc::SQLException
152 if a database access error occurs.
154 void setFilter
([in] string filter
)
155 raises
(com
::sun
::star
::sdbc
::SQLException
);
156 //-------------------------------------------------------------------------
158 /** makes it possibile to set a sort condition for the query.
160 the order part to set
161 @throws com::sun::star::sdbc::SQLException
162 if a database access error occurs.
164 void setOrder
([in] string order
)
165 raises
(com
::sun
::star
::sdbc
::SQLException
);
168 //=============================================================================
172 /*=============================================================================
174 =============================================================================*/