<html> <head> <title>Interface XSingleSelectQueryComposer</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" type="text/css" href="../../../../idl.css"> </head> <body> <div id="adc-idlref"> <a name="_top_"> </a><table class="navimain" border="0" cellpadding="3"> <tr> <td class="navimain"><a href="../module-ix.html" class="navimain">Overview</a></td> <td class="navimain"><a href="module-ix.html" class="navimain">Module</a></td> <td class="navimain"><a href="XSingleSelectQueryComposer-xref.html" class="navimain">Use</a></td> <td class="navimainnone">Devguide</td> <td class="navimain"><a href="../../../../index-files/index-1.html" class="navimain">Index</a></td> </tr> </table> <table class="navisub" border="0" cellpadding="0"> <tr> <td class="navisub"><a href="#MethodsSummary" class="navisub">Methods' Summary</a></td> <td class="navisub"><a href="#AttributesSummary" class="navisub">Attributes' Summary</a></td> <td class="navisub"><a href="#MethodsDetails" class="navisub">Methods' Details</a></td> <td class="navisub"><a href="#AttributesDetails" class="navisub">Attributes' Details</a></td> </tr> </table> <hr> <table border="0" width="100%" cellpadding="5" cellspacing="3" class="title-table" style="margin-bottom:6pt;"> <tr> <td><p class="namechain"><a href="../../../../module-ix.html" class="namechain">::</a> <a href="../../../module-ix.html" class="namechain">com</a> :: <a href="../../module-ix.html" class="namechain">sun</a> :: <a href="../module-ix.html" class="namechain">star</a> :: <a href="module-ix.html" class="namechain">sdb</a> :: </p> </td> </tr> <tr> <td class="title"><table class="title-table" width="99%"> <tr> <td width="25%" class="title2">unpublished </td> <td width="50%" class="title">interface XSingleSelectQueryComposer</td> <td width="*"/></tr> </table> </td> </tr> <tr> <td><dl> <dt><b>Base Interfaces</b></dt> <dd><pre style="font-family:monospace;"><strong>XSingleSelectQueryComposer</strong> ┗ <a href="XSingleSelectQueryAnalyzer.html">XSingleSelectQueryAnalyzer</a> </pre></dd> <dd><a name/><table border="1" width="100%" cellpadding="5" cellspacing="0" class="crosstitle"> <tr> <td class="imsum_left"><a href="XSingleSelectQueryAnalyzer.html">XSingleSelectQueryAnalyzer</a></td> <td class="imsum_right"><dl> <dt>(referenced interface's summary:)</dt> <dd>simplifies the analyzing of single select statements. </dd> </dl> </td> </tr> </table> </dd> </dl> </td> </tr> <tr> <td><dl> <dt><b>Usage Restrictions</b></dt> <dd><i>not published</i></dd> <dt><b>Description</b></dt> <dd>simplifies the composing of single select statements. </dd> <dd><p> The interface can be used for composing single SELECT statements without knowing the structure of the used query. </p> </dd> <dt><b>See also</b></dt> <dd><a href="SingleSelectQueryComposer.html">SingleSelectQueryComposer</a></dd> </dl> </td> </tr> </table> <hr> <a name="MethodsSummary"/><table border="1" width="100%" cellpadding="5" cellspacing="0" class="subtitle"> <tr> <td class="subtitle" colspan="2">Methods' Summary</td> </tr> <tr> <td class="imsum_left"><a href="#setFilter">setFilter</a></td> <td class="imsum_right">makes it possible to set a filter condition for the query. </td> </tr> <tr> <td class="imsum_left"><a href="#setStructuredFilter">setStructuredFilter</a></td> <td class="imsum_right">appends a new set of filter criteria which is split into levels. </td> </tr> <tr> <td class="imsum_left"><a href="#appendFilterByColumn">appendFilterByColumn</a></td> <td class="imsum_right">appends a new filter condition by a <a href="DataColumn.html">DataColumn</a> providing the name and the value for the filter. The value property must be supported by the <a href="DataColumn.html">DataColumn</a>. </td> </tr> <tr> <td class="imsum_left"><a href="#setGroup">setGroup</a></td> <td class="imsum_right">makes it possibile to set a group for the query. </td> </tr> <tr> <td class="imsum_left"><a href="#appendGroupByColumn">appendGroupByColumn</a></td> <td class="imsum_right">appends an additional part to the group criteria of the select statement. The column must be a ::com::sun::star::<a href="../sdbcx/module-ix.html">sdbcx</a>::<a href="../sdbcx/Column.html">Column</a>. </td> </tr> <tr> <td class="imsum_left"><a href="#setHavingClause">setHavingClause</a></td> <td class="imsum_right">makes it possible to set a HAVING filter condition for the query. </td> </tr> <tr> <td class="imsum_left"><a href="#setStructuredHavingClause">setStructuredHavingClause</a></td> <td class="imsum_right">appends a new set of HAVING filter criteria which is split into levels. </td> </tr> <tr> <td class="imsum_left"><a href="#appendHavingClauseByColumn">appendHavingClauseByColumn</a></td> <td class="imsum_right">appends a new HAVING filter condition by a <a href="DataColumn.html">DataColumn</a> providing the name and the value for the filter. </td> </tr> <tr> <td class="imsum_left"><a href="#setOrder">setOrder</a></td> <td class="imsum_right">makes it possibile to set a sort condition for the query. </td> </tr> <tr> <td class="imsum_left"><a href="#appendOrderByColumn">appendOrderByColumn</a></td> <td class="imsum_right">appends an additional part to the sort order criteria of the select statement. The column must be a ::com::sun::star::<a href="../sdbcx/module-ix.html">sdbcx</a>::<a href="../sdbcx/Column.html">Column</a>. </td> </tr> </table> <a name="AttributesSummary"/><table border="1" width="100%" cellpadding="5" cellspacing="0" class="subtitle"> <tr> <td class="subtitle" colspan="2">Attributes' Summary</td> </tr> <tr> <td class="imsum_left"><a href="#ElementaryQuery">ElementaryQuery</a></td> <td class="imsum_right">sets a new elementary query for the composer </td> </tr> </table> <a name="MethodsDetails"/><table border="1" width="100%" cellpadding="5" cellspacing="0" class="subtitle"> <tr> <td class="subtitle">Methods' Details</td> </tr> <tr> <td class="imdetail"><a name="setFilter" class="membertitle">setFilter</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3">void</td> </tr> <tr> <td valign="top"><b>setFilter</b>(</td> <td valign="top">[in] string</td> <td valign="bottom"> filter )</td> </tr> <tr> <td valign="top" align="right">raises( </td> <td valign="top" colspan="2">::com::sun::star::<a href="../sdbc/module-ix.html">sdbc</a>::<a href="../sdbc/SQLException.html">SQLException</a> );</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>makes it possible to set a filter condition for the query. </dd> <dt><b>Parameter filter</b></dt> <dd>the filter to set </dd> <dt><b>Throws</b></dt> <dd>com::sun::star::sdbc::SQLException if a database access error occurs or the statement isn't valid or the statement isn't parseable. </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="setStructuredFilter" class="membertitle">setStructuredFilter</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3">void</td> </tr> <tr> <td valign="top"><b>setStructuredFilter</b>(</td> <td valign="top">[in] sequence< sequence< ::com::sun::star::<a href="../beans/module-ix.html">beans</a>::<a href="../beans/PropertyValue.html">PropertyValue</a> > ></td> <td valign="bottom"> filter )</td> </tr> <tr> <td valign="top" align="right">raises( </td> <td valign="top" colspan="2">::com::sun::star::<a href="../sdbc/module-ix.html">sdbc</a>::<a href="../sdbc/SQLException.html">SQLException</a>,<br> ::com::sun::star::<a href="../lang/module-ix.html">lang</a>::<a href="../lang/IllegalArgumentException.html">IllegalArgumentException</a> );</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>appends a new set of filter criteria which is split into levels. </dd> <dt><b>Parameter filter</b></dt> <dd>The filter criteria is split into levels. Each level represents the OR criterias. Within each level, the filters are provided as an AND criteria with the name of the column and the filter condition. The filter condition is of type string. The operator used, is defined by <a href="SQLFilterOperator.html">SQLFilterOperator</a>. </dd> <dt><b>Throws</b></dt> <dd>com::sun::star::sdbc::SQLException if a database access error occurs. </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="appendFilterByColumn" class="membertitle">appendFilterByColumn</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3">void</td> </tr> <tr> <td valign="top"><b>appendFilterByColumn</b>(</td> <td valign="top">[in] ::com::sun::star::<a href="../beans/module-ix.html">beans</a>::<a href="../beans/XPropertySet.html">XPropertySet</a></td> <td valign="bottom"> column,</td> </tr> <tr> <td/><td valign="top">[in] boolean</td> <td valign="bottom"> andCriteria )</td> </tr> <tr> <td valign="top" align="right">raises( </td> <td valign="top" colspan="2">::com::sun::star::<a href="../sdbc/module-ix.html">sdbc</a>::<a href="../sdbc/SQLException.html">SQLException</a> );</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>appends a new filter condition by a <a href="DataColumn.html">DataColumn</a> providing the name and the value for the filter. The value property must be supported by the <a href="DataColumn.html">DataColumn</a>. </dd> <dt><b>Parameter column</b></dt> <dd>the column which is used to create a filter @paran andCriteria If <b>true</b> the filter condition will be appended as an AND condition, otherwise the new filter condition will be appended as OR criteria. E.g. (xx AND bb AND cc) OR newCriteria </dd> <dt><b>Throws</b></dt> <dd>com::sun::star::sdbc::SQLException if a database access error occurs. </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="setGroup" class="membertitle">setGroup</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3">void</td> </tr> <tr> <td valign="top"><b>setGroup</b>(</td> <td valign="top">[in] string</td> <td valign="bottom"> group )</td> </tr> <tr> <td valign="top" align="right">raises( </td> <td valign="top" colspan="2">::com::sun::star::<a href="../sdbc/module-ix.html">sdbc</a>::<a href="../sdbc/SQLException.html">SQLException</a> );</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>makes it possibile to set a group for the query. </dd> <dt><b>Parameter group</b></dt> <dd>the group part to set </dd> <dt><b>Throws</b></dt> <dd>com::sun::star::sdbc::SQLException if a database access error occurs or the statement isn't valid or the statement isn't parseable.. </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="appendGroupByColumn" class="membertitle">appendGroupByColumn</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3">void</td> </tr> <tr> <td valign="top"><b>appendGroupByColumn</b>(</td> <td valign="top">[in] ::com::sun::star::<a href="../beans/module-ix.html">beans</a>::<a href="../beans/XPropertySet.html">XPropertySet</a></td> <td valign="bottom"> column )</td> </tr> <tr> <td valign="top" align="right">raises( </td> <td valign="top" colspan="2">::com::sun::star::<a href="../sdbc/module-ix.html">sdbc</a>::<a href="../sdbc/SQLException.html">SQLException</a> );</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>appends an additional part to the group criteria of the select statement. The column must be a ::com::sun::star::<a href="../sdbcx/module-ix.html">sdbcx</a>::<a href="../sdbcx/Column.html">Column</a>. </dd> <dt><b>Parameter column</b></dt> <dd>the column which is used to create a group part </dd> <dt><b>Throws</b></dt> <dd>com::sun::star::sdbc::SQLException if a database access error occurs. </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="setHavingClause" class="membertitle">setHavingClause</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3">void</td> </tr> <tr> <td valign="top"><b>setHavingClause</b>(</td> <td valign="top">[in] string</td> <td valign="bottom"> filter )</td> </tr> <tr> <td valign="top" align="right">raises( </td> <td valign="top" colspan="2">::com::sun::star::<a href="../sdbc/module-ix.html">sdbc</a>::<a href="../sdbc/SQLException.html">SQLException</a> );</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>makes it possible to set a HAVING filter condition for the query. </dd> <dt><b>Parameter filter</b></dt> <dd>the filter to set </dd> <dt><b>Throws</b></dt> <dd>com::sun::star::sdbc::SQLException if a database access error occurs or the statement isn't valid or the statement isn't parseable. </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="setStructuredHavingClause" class="membertitle">setStructuredHavingClause</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3">void</td> </tr> <tr> <td valign="top"><b>setStructuredHavingClause</b>(</td> <td valign="top">[in] sequence< sequence< ::com::sun::star::<a href="../beans/module-ix.html">beans</a>::<a href="../beans/PropertyValue.html">PropertyValue</a> > ></td> <td valign="bottom"> filter )</td> </tr> <tr> <td valign="top" align="right">raises( </td> <td valign="top" colspan="2">::com::sun::star::<a href="../sdbc/module-ix.html">sdbc</a>::<a href="../sdbc/SQLException.html">SQLException</a> );</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>appends a new set of HAVING filter criteria which is split into levels. </dd> <dt><b>Parameter filter</b></dt> <dd>The HAVING filter criteria is split into levels. Each level represents the OR criterias. Within each level, the filters are provided as an AND criteria with the name of the column and the filter condition. The filter condition is of type string. The operator used, is defined by <a href="SQLFilterOperator.html">SQLFilterOperator</a>. </dd> <dt><b>Throws</b></dt> <dd>com::sun::star::sdbc::SQLException if a database access error occurs. </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="appendHavingClauseByColumn" class="membertitle">appendHavingClauseByColumn</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3">void</td> </tr> <tr> <td valign="top"><b>appendHavingClauseByColumn</b>(</td> <td valign="top">[in] ::com::sun::star::<a href="../beans/module-ix.html">beans</a>::<a href="../beans/XPropertySet.html">XPropertySet</a></td> <td valign="bottom"> column,</td> </tr> <tr> <td/><td valign="top">[in] boolean</td> <td valign="bottom"> andCriteria )</td> </tr> <tr> <td valign="top" align="right">raises( </td> <td valign="top" colspan="2">::com::sun::star::<a href="../sdbc/module-ix.html">sdbc</a>::<a href="../sdbc/SQLException.html">SQLException</a> );</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>appends a new HAVING filter condition by a <a href="DataColumn.html">DataColumn</a> providing the name and the value for the filter. </dd> <dt><b>Parameter column</b></dt> <dd>the column which is used to create a filter @paran andCriteria If <b>true</b> the filter condition will be appended as an AND condition, otherwise the new filter condition will be appended as OR criteria. E.g. (xx AND bb AND cc) OR newCriteria </dd> <dt><b>Throws</b></dt> <dd>com::sun::star::sdbc::SQLException if a database access error occurs. </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="setOrder" class="membertitle">setOrder</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3">void</td> </tr> <tr> <td valign="top"><b>setOrder</b>(</td> <td valign="top">[in] string</td> <td valign="bottom"> order )</td> </tr> <tr> <td valign="top" align="right">raises( </td> <td valign="top" colspan="2">::com::sun::star::<a href="../sdbc/module-ix.html">sdbc</a>::<a href="../sdbc/SQLException.html">SQLException</a> );</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>makes it possibile to set a sort condition for the query. </dd> <dt><b>Parameter order</b></dt> <dd>the order part to set </dd> <dt><b>Throws</b></dt> <dd>com::sun::star::sdbc::SQLException if a database access error occurs or the order isn't valid or the statement isn't parseable. </dd> </dl> </td> </tr> </table> </td> </tr> <tr> <td class="imdetail"><a name="appendOrderByColumn" class="membertitle">appendOrderByColumn</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center"> <tr> <td><table class="table-in-method" border="0"> <tr> <td valign="top" colspan="3">void</td> </tr> <tr> <td valign="top"><b>appendOrderByColumn</b>(</td> <td valign="top">[in] ::com::sun::star::<a href="../beans/module-ix.html">beans</a>::<a href="../beans/XPropertySet.html">XPropertySet</a></td> <td valign="bottom"> column,</td> </tr> <tr> <td/><td valign="top">[in] boolean</td> <td valign="bottom"> ascending )</td> </tr> <tr> <td valign="top" align="right">raises( </td> <td valign="top" colspan="2">::com::sun::star::<a href="../sdbc/module-ix.html">sdbc</a>::<a href="../sdbc/SQLException.html">SQLException</a> );</td> </tr> </table> <hr> <dl> <dt><b>Description</b></dt> <dd>appends an additional part to the sort order criteria of the select statement. The column must be a ::com::sun::star::<a href="../sdbcx/module-ix.html">sdbcx</a>::<a href="../sdbcx/Column.html">Column</a>. </dd> <dt><b>Parameter column</b></dt> <dd>the column which is used to create a order part </dd> <dt><b>Parameter ascending</b></dt> <dd><b>true</b> when the order should be ascending, otherwise if <b>false</b> descending. </dd> <dt><b>Throws</b></dt> <dd>com::sun::star::sdbc::SQLException if a database access error occurs. </dd> </dl> </td> </tr> </table> </td> </tr> </table> <a name="AttributesDetails"/><table border="1" width="100%" cellpadding="5" cellspacing="0" class="subtitle"> <tr> <td class="subtitle">Attributes' Details</td> </tr> <tr> <td class="imdetail"><a name="ElementaryQuery" class="membertitle">ElementaryQuery</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-data" bgcolor="#ffffff" align="center"> <tr> <td>string <b>ElementaryQuery</b><dl> <dd>set raises (::com::sun::star::<a href="../sdbc/module-ix.html">sdbc</a>::<a href="../sdbc/SQLException.html">SQLException</a>);</dd> </dl> <hr> <dl> <dt><b>Description</b></dt> <dd>sets a new elementary query for the composer </dd> <dd><p>An elementary query or statement is a (single select) statement whose parts are not covered by the various set and get methods of the composer. That is, if the elementary statement contains a filter clause, a call to <a href="XSingleSelectQueryAnalyzer.html">XSingleSelectQueryAnalyzer</a>::<a href="XSingleSelectQueryAnalyzer.html#getFilter">getFilter</a> will not return you this filter. Instead, only filters which have been set using for instance <a href="#setFilter">setFilter</a> are covered by the get methods.</p> <p>The only methods which take all parts of the elementary statement into account are <a href="XSingleSelectQueryAnalyzer.html">XSingleSelectQueryAnalyzer</a>::<a href="XSingleSelectQueryAnalyzer.html#getQuery">getQuery</a> and <a href="XSingleSelectQueryAnalyzer.html">XSingleSelectQueryAnalyzer</a>::<a href="XSingleSelectQueryAnalyzer.html#getQueryWithSubstitution">getQueryWithSubstitution</a>, which always returns the complete composed query.</p> <p>As a result, you can use the composer to build culmulative filter expressions. That is, you can set <a href="#ElementaryQuery">ElementaryQuery</a> to a statement already containing filters, and then use <a href="#setFilter">setFilter</a> to append additional filters.</p> <p>The very same holds for sort orders, <code>HAVING</code> and <code>GROUP BY</code> clauses.</p> <p>There are various use cases for this. For instance, you might want to use the statement represented by a <a href="QueryDefinition.html">QueryDefinition</a>, and extend it with additional filters or sort orders, while not touching the respective parts already present in <a href="QueryDefinition.html">QueryDefinition</a>::<a href="QueryDefinition.html#Command">Command</a>. This can be achieved by setting the <a href="QueryDefinition.html">QueryDefinition</a>::<a href="QueryDefinition.html#Command">Command</a> as <a href="#ElementaryQuery">ElementaryQuery</a> of a <a href="SingleSelectQueryComposer.html">SingleSelectQueryComposer</a>.</p> <p>If, in such a scenario, you would be interested in the filter part of the <a href="QueryDefinition.html">QueryDefinition</a>::<a href="QueryDefinition.html#Command">Command</a>, you would set it via <a href="XSingleSelectQueryAnalyzer.html">XSingleSelectQueryAnalyzer</a>::<a href="XSingleSelectQueryAnalyzer.html#setQuery">setQuery</a>, and retrieve the filter part via <a href="XSingleSelectQueryAnalyzer.html">XSingleSelectQueryAnalyzer</a>::<a href="XSingleSelectQueryAnalyzer.html#getFilter">getFilter</a>.</p> <p>If you'd be interested in the composed filter, you would set the <a href="QueryDefinition.html">QueryDefinition</a>::<a href="QueryDefinition.html#Command">Command</a> as <a href="#ElementaryQuery">ElementaryQuery</a>, add your filter, and propagate the resulting query (<a href="XSingleSelectQueryAnalyzer.html">XSingleSelectQueryAnalyzer</a>::<a href="XSingleSelectQueryAnalyzer.html#getQuery">getQuery</a>) to an <a href="SingleSelectQueryAnalyzer.html">SingleSelectQueryAnalyzer</a> instance via <a href="XSingleSelectQueryAnalyzer.html">XSingleSelectQueryAnalyzer</a>::<a href="XSingleSelectQueryAnalyzer.html#setQuery">setQuery</a>.</p> </dd> </dl> </td> </tr> </table> </td> </tr> </table> <a href="#_top_">Top of Page</a><hr size="3"><p class="copyright" align="center">Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.</p> </div> <!-- id="adc-idlref" --> </body> </html>