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