LibreOffice Module dbaccess (master) 1
|
#include <SingleSelectQueryComposer.hxx>
Public Member Functions | |
OSingleSelectQueryComposer (const css::uno::Reference< css::container::XNameAccess > &_xTableSupplier, const css::uno::Reference< css::sdbc::XConnection > &_xConnection, const css::uno::Reference< css::uno::XComponentContext > &_rContext) | |
void SAL_CALL | disposing () override |
virtual css::uno::Sequence< css::uno::Type > SAL_CALL | getTypes () override |
virtual css::uno::Sequence< sal_Int8 > SAL_CALL | getImplementationId () override |
DECLARE_SERVICE_INFO () | |
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL | getPropertySetInfo () override |
virtual ::cppu::IPropertyArrayHelper &SAL_CALL | getInfoHelper () override |
virtual ::cppu::IPropertyArrayHelper * | createArrayHelper () const override |
virtual OUString SAL_CALL | getElementaryQuery () override |
virtual void SAL_CALL | setElementaryQuery (const OUString &_rElementary) override |
virtual void SAL_CALL | setFilter (const OUString &filter) override |
virtual void SAL_CALL | setStructuredFilter (const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > &filter) override |
virtual void SAL_CALL | appendFilterByColumn (const css::uno::Reference< css::beans::XPropertySet > &column, sal_Bool andCriteria, sal_Int32 filterOperator) override |
virtual void SAL_CALL | appendGroupByColumn (const css::uno::Reference< css::beans::XPropertySet > &column) override |
virtual void SAL_CALL | setGroup (const OUString &group) override |
virtual void SAL_CALL | setHavingClause (const OUString &filter) override |
virtual void SAL_CALL | setStructuredHavingClause (const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > &filter) override |
virtual void SAL_CALL | appendHavingClauseByColumn (const css::uno::Reference< css::beans::XPropertySet > &column, sal_Bool andCriteria, sal_Int32 filterOperator) override |
virtual void SAL_CALL | appendOrderByColumn (const css::uno::Reference< css::beans::XPropertySet > &column, sal_Bool ascending) override |
virtual void SAL_CALL | setOrder (const OUString &order) override |
virtual OUString SAL_CALL | getQuery () override |
virtual void SAL_CALL | setQuery (const OUString &command) override |
virtual void SAL_CALL | setCommand (const OUString &command, sal_Int32 CommandType) override |
virtual OUString SAL_CALL | getFilter () override |
virtual css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > SAL_CALL | getStructuredFilter () override |
virtual OUString SAL_CALL | getGroup () override |
virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL | getGroupColumns () override |
virtual OUString SAL_CALL | getHavingClause () override |
virtual css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > SAL_CALL | getStructuredHavingClause () override |
virtual OUString SAL_CALL | getOrder () override |
virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL | getOrderColumns () override |
virtual OUString SAL_CALL | getQueryWithSubstitution () override |
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL | getColumns () override |
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL | getTables () override |
virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL | getParameters () override |
Public Member Functions inherited from comphelper::OMutexAndBroadcastHelper | |
OMutexAndBroadcastHelper () | |
::osl::Mutex & | GetMutex () |
::cppu::OBroadcastHelper & | GetBroadcastHelper () |
const ::cppu::OBroadcastHelper & | GetBroadcastHelper () const |
Public Member Functions inherited from OSubComponent | |
OSubComponent (::osl::Mutex &_rMutex, const css::uno::Reference< css::uno::XInterface > &_xParent) | |
virtual void SAL_CALL | release () noexcept override |
operator css::uno::Reference< css::uno::XInterface > () const | |
Public Member Functions inherited from comphelper::OPropertyContainer | |
virtual | ~OPropertyContainer () |
Public Member Functions inherited from comphelper::OPropertyArrayUsageHelper< OSingleSelectQueryComposer > | |
OPropertyArrayUsageHelper () | |
virtual | ~OPropertyArrayUsageHelper () |
::cppu::IPropertyArrayHelper * | getArrayHelper () |
Public Member Functions inherited from cppu::ImplHelper5< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 > | |
virtual css::uno::Any SAL_CALL | queryInterface (css::uno::Type const &rType) SAL_OVERRIDE |
virtual css::uno::Sequence< css::uno::Type > SAL_CALL | getTypes () SAL_OVERRIDE |
virtual css::uno::Sequence< sal_Int8 > SAL_CALL | getImplementationId () SAL_OVERRIDE |
Protected Member Functions | |
virtual | ~OSingleSelectQueryComposer () override |
Protected Member Functions inherited from OSubComponent | |
virtual | ~OSubComponent () override |
Protected Member Functions inherited from comphelper::OPropertyContainer | |
OPropertyContainer (::cppu::OBroadcastHelper &_rBHelper) | |
virtual sal_Bool SAL_CALL | convertFastPropertyValue (css::uno::Any &rConvertedValue, css::uno::Any &rOldValue, sal_Int32 nHandle, const css::uno::Any &rValue) override |
virtual void SAL_CALL | setFastPropertyValue_NoBroadcast (sal_Int32 nHandle, const css::uno::Any &rValue) override |
virtual void SAL_CALL | getFastPropertyValue (css::uno::Any &rValue, sal_Int32 nHandle) const override |
virtual css::uno::Any SAL_CALL | getFastPropertyValue (sal_Int32 nHandle) override final |
virtual void | getFastPropertyValue (std::unique_lock< std::mutex > &rGuard, css::uno::Any &rValue, sal_Int32 nHandle) const =0 |
virtual void SAL_CALL | setFastPropertyValue (sal_Int32 nHandle, const css::uno::Any &rValue) override final |
Protected Member Functions inherited from comphelper::OPropertyContainerHelper | |
OPropertyContainerHelper () | |
~OPropertyContainerHelper () | |
void | registerProperty (const OUString &_rName, sal_Int32 _nHandle, sal_Int32 _nAttributes, void *_pPointerToMember, const css::uno::Type &_rMemberType) |
void | registerMayBeVoidProperty (const OUString &_rName, sal_Int32 _nHandle, sal_Int32 _nAttributes, css::uno::Any *_pPointerToMember, const css::uno::Type &_rExpectedType) |
void | registerPropertyNoMember (const OUString &_rName, sal_Int32 _nHandle, sal_Int32 _nAttributes, const css::uno::Type &_rType, css::uno::Any const &_pInitialValue) |
void | revokeProperty (sal_Int32 _nHandle) |
bool | isRegisteredProperty (sal_Int32 _nHandle) const |
bool | isRegisteredProperty (const OUString &_rName) const |
bool | convertFastPropertyValue (css::uno::Any &rConvertedValue, css::uno::Any &rOldValue, sal_Int32 nHandle, const css::uno::Any &rValue) |
void | setFastPropertyValue (sal_Int32 nHandle, const css::uno::Any &rValue) |
void | getFastPropertyValue (css::uno::Any &rValue, sal_Int32 nHandle) const |
void | describeProperties (css::uno::Sequence< css::beans::Property > &_rProps) const |
const css::beans::Property & | getProperty (const OUString &_rName) const |
virtual ::cppu::IPropertyArrayHelper * | createArrayHelper () const =0 |
Protected Member Functions inherited from cppu::ImplHelper5< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 > | |
~ImplHelper5 () SAL_NOEXCEPT | |
Private Types | |
enum | SQLPart { Where = 0 , Group , Having , Order , SQLPartCount } |
enum | EColumnType { SelectColumns = 0 , GroupByColumns = 1 , OrderColumns = 2 , ParameterColumns = 3 } |
typedef std::function< const ::connectivity::OSQLParseNode *(::connectivity::OSQLParseTreeIterator *)> | TGetParseNode |
Private Member Functions | |
bool | setORCriteria (::connectivity::OSQLParseNode const *pCondition, ::connectivity::OSQLParseTreeIterator &_rIterator, std::vector< std::vector< css::beans::PropertyValue > > &rFilters, const css::uno::Reference< css::util::XNumberFormatter > &xFormatter) const |
bool | setANDCriteria (::connectivity::OSQLParseNode const *pCondition, ::connectivity::OSQLParseTreeIterator &_rIterator, std::vector< css::beans::PropertyValue > &rFilters, const css::uno::Reference< css::util::XNumberFormatter > &xFormatter) const |
bool | setLikePredicate (::connectivity::OSQLParseNode const *pCondition, ::connectivity::OSQLParseTreeIterator const &_rIterator, std::vector< css::beans::PropertyValue > &rFilters, const css::uno::Reference< css::util::XNumberFormatter > &xFormatter) const |
bool | setComparisonPredicate (::connectivity::OSQLParseNode const *pCondition, ::connectivity::OSQLParseTreeIterator const &_rIterator, std::vector< css::beans::PropertyValue > &rFilters, const css::uno::Reference< css::util::XNumberFormatter > &xFormatter) const |
OUString | getTableAlias (const css::uno::Reference< css::beans::XPropertySet > &column) const |
void | clearCurrentCollections () |
void | clearColumns (const EColumnType _eType) |
OUString | getStatementPart (TGetParseNode const &_aGetFunctor, ::connectivity::OSQLParseTreeIterator &_rIterator) |
retrieves a particular part of a statement More... | |
void | setQuery_Impl (const OUString &command) |
void | setConditionByColumn (const css::uno::Reference< css::beans::XPropertySet > &column, bool andCriteria, std::function< bool(OSingleSelectQueryComposer *, const OUString &)> const &_aSetFunctor, sal_Int32 filterOperator) |
css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > | getStructuredCondition (TGetParseNode const &_aGetFunctor) |
getStructuredCondition returns the structured condition for the where or having clause More... | |
css::uno::Reference< css::container::XIndexAccess > | setCurrentColumns (EColumnType _eType, const ::rtl::Reference< ::connectivity::OSQLColumns > &_rCols) |
bool | implSetFilter (const OUString &_sFilter) |
bool | implSetHavingClause (const OUString &_sFilter) |
OUString | getSQLPart (SQLPart _ePart, ::connectivity::OSQLParseTreeIterator &_rIterator, bool _bWithKeyword) |
returns the part of the select statement More... | |
void | setSingleAdditiveClause (SQLPart _ePart, const OUString &_rClause) |
sets a single "additive" clause, means a filter/groupby/having/order clause More... | |
OUString | composeStatementFromParts (const std::vector< OUString > &_rParts) |
composes a statement from m_aPureSelectSQL and the 4 usual clauses More... | |
OUString | impl_getColumnRealName_throw (const css::uno::Reference< css::beans::XPropertySet > &column, bool bGroupBy) |
return the name of the column in the source table. More... | |
OUString | impl_getColumnNameOrderBy_throw (const css::uno::Reference< css::beans::XPropertySet > &column) |
return the name of the column in the query for ORDER BY clause. More... | |
Static Private Member Functions | |
static void | incSQLPart (SQLPart &e) |
static OUString | getColumnName (::connectivity::OSQLParseNode const *pColumnRef, ::connectivity::OSQLParseTreeIterator const &_rIterator) |
static sal_Int32 | getPredicateType (::connectivity::OSQLParseNode const *_pPredicate) |
static OUString | getKeyword (SQLPart _ePart) |
retrieves the keyword for the given SQLPart More... | |
Private Attributes | |
::svxform::OSystemParseContext | m_aParseContext |
::connectivity::OSQLParser | m_aSqlParser |
::connectivity::OSQLParseTreeIterator | m_aSqlIterator |
::connectivity::OSQLParseTreeIterator | m_aAdditiveIterator |
std::vector< std::unique_ptr< OPrivateColumns > > | m_aColumnsCollection |
std::vector< std::unique_ptr< OPrivateTables > > | m_aTablesCollection |
std::vector< OUString > | m_aElementaryParts |
css::uno::Reference< css::sdbc::XConnection > | m_xConnection |
css::uno::Reference< css::sdbc::XDatabaseMetaData > | m_xMetaData |
css::uno::Reference< css::container::XNameAccess > | m_xConnectionTables |
css::uno::Reference< css::container::XNameAccess > | m_xConnectionQueries |
css::uno::Reference< css::util::XNumberFormatsSupplier > | m_xNumberFormatsSupplier |
css::uno::Reference< css::uno::XComponentContext > | m_aContext |
css::uno::Reference< css::script::XTypeConverter > | m_xTypeConverter |
std::vector< std::unique_ptr< OPrivateColumns > > | m_aCurrentColumns |
std::unique_ptr< OPrivateTables > | m_pTables |
OUString | m_aPureSelectSQL |
OUString | m_sDecimalSep |
OUString | m_sCommand |
css::lang::Locale | m_aLocale |
sal_Int32 | m_nBoolCompareMode |
sal_Int32 | m_nCommandType |
OUString | m_sOriginal |
Additional Inherited Members | |
Static Protected Member Functions inherited from comphelper::OPropertyContainer | |
static css::uno::Sequence< css::uno::Type > | getBaseTypes () |
Static Protected Member Functions inherited from comphelper::OPropertyArrayUsageHelper< OSingleSelectQueryComposer > | |
static std::mutex & | theMutex () |
Protected Attributes inherited from comphelper::OMutexAndBroadcastHelper | |
::osl::Mutex | m_aMutex |
::cppu::OBroadcastHelper | m_aBHelper |
Protected Attributes inherited from OSubComponent | |
css::uno::Reference< css::uno::XInterface > | m_xParent |
Static Protected Attributes inherited from comphelper::OPropertyArrayUsageHelper< OSingleSelectQueryComposer > | |
static sal_Int32 | s_nRefCount |
::cppu::IPropertyArrayHelper * | s_pProps |
Definition at line 53 of file SingleSelectQueryComposer.hxx.
|
private |
Definition at line 77 of file SingleSelectQueryComposer.hxx.
|
private |
Enumerator | |
---|---|
SelectColumns | |
GroupByColumns | |
OrderColumns | |
ParameterColumns |
Definition at line 69 of file SingleSelectQueryComposer.hxx.
|
private |
Enumerator | |
---|---|
Where | |
Group | |
Having | |
Order | |
SQLPartCount |
Definition at line 59 of file SingleSelectQueryComposer.hxx.
|
overrideprotectedvirtual |
Definition at line 261 of file SingleSelectQueryComposer.cxx.
OSingleSelectQueryComposer::OSingleSelectQueryComposer | ( | const css::uno::Reference< css::container::XNameAccess > & | _xTableSupplier, |
const css::uno::Reference< css::sdbc::XConnection > & | _xConnection, | ||
const css::uno::Reference< css::uno::XComponentContext > & | _rContext | ||
) |
Definition at line 215 of file SingleSelectQueryComposer.cxx.
References aData, Any, COMMAND, CommandType, Exception, dbaccess::getDataSource(), dbtools::getDataSourceSetting(), dbtools::getNumberFormats(), svxform::OSystemParseContext::getPreferredLocale(), m_aContext, m_aCurrentColumns, m_aLocale, m_aMutex, m_aParseContext, m_nBoolCompareMode, m_sDecimalSep, m_sOriginal, m_xConnection, m_xConnectionQueries, m_xConnectionTables, m_xNumberFormatsSupplier, PROPERTY_BOOLEANCOMPARISONMODE(), PROPERTY_ID_ORIGINAL, PROPERTY_ORIGINAL(), and comphelper::OPropertyContainerHelper::registerProperty().
|
overridevirtual |
Definition at line 459 of file SingleSelectQueryComposer.cxx.
References implSetFilter(), and setConditionByColumn().
|
overridevirtual |
Definition at line 588 of file SingleSelectQueryComposer.cxx.
References dbaccess::TokenComposer::append(), dbaccess::TokenComposer::getComposedAndClear(), getGroup(), impl_getColumnRealName_throw(), comphelper::OMutexAndBroadcastHelper::m_aMutex, and setGroup().
|
overridevirtual |
Definition at line 453 of file SingleSelectQueryComposer.cxx.
References implSetHavingClause(), and setConditionByColumn().
|
overridevirtual |
Definition at line 574 of file SingleSelectQueryComposer.cxx.
References COMMA, getOrder(), impl_getColumnNameOrderBy_throw(), comphelper::OMutexAndBroadcastHelper::m_aMutex, and setOrder().
|
private |
Definition at line 1440 of file SingleSelectQueryComposer.cxx.
References dbaccess::OPrivateColumns::disposing(), m_aColumnsCollection, and m_aCurrentColumns.
Referenced by setSingleAdditiveClause().
|
private |
Definition at line 1450 of file SingleSelectQueryComposer.cxx.
References m_aColumnsCollection, m_aCurrentColumns, m_aTablesCollection, and m_pTables.
Referenced by disposing(), setCommand(), setElementaryQuery(), and setQuery().
|
private |
composes a statement from m_aPureSelectSQL and the 4 usual clauses
Definition at line 598 of file SingleSelectQueryComposer.cxx.
References getKeyword(), incSQLPart(), m_aPureSelectSQL, SQLPartCount, and Where.
Referenced by getElementaryQuery(), and setElementaryQuery().
|
overridevirtual |
Implements comphelper::OPropertyArrayUsageHelper< OSingleSelectQueryComposer >.
Definition at line 323 of file SingleSelectQueryComposer.cxx.
References comphelper::OPropertyContainerHelper::describeProperties().
dbaccess::OSingleSelectQueryComposer::DECLARE_SERVICE_INFO | ( | ) |
|
override |
Definition at line 266 of file SingleSelectQueryComposer.cxx.
References clearCurrentCollections(), m_aAdditiveIterator, comphelper::OMutexAndBroadcastHelper::m_aMutex, m_aSqlIterator, m_xConnection, and m_xConnectionTables.
|
staticprivate |
Definition at line 1317 of file SingleSelectQueryComposer.cxx.
References connectivity::OSQLParseTreeIterator::getColumnRange().
Referenced by setANDCriteria(), setComparisonPredicate(), and setLikePredicate().
|
overridevirtual |
Definition at line 767 of file SingleSelectQueryComposer.cxx.
References Any, connectivity::parse::OParseColumn::createColumnForResultSet(), connectivity::parse::OParseColumn::createColumnsForResultSet(), dbaccess::OPrivateColumns::createWithIntrinsicNames(), DBG_UNHANDLED_EXCEPTION, Exception, getParameters(), connectivity::OSQLParseTreeIterator::getSelectColumns(), getSQLPart(), i, m_aCurrentColumns, comphelper::OMutexAndBroadcastHelper::m_aMutex, m_aPureSelectSQL, m_aSqlIterator, m_aSqlParser, m_nCommandType, m_sCommand, m_xConnection, m_xConnectionQueries, m_xMetaData, nCount, connectivity::OSQLParser::parseTree(), PROPERTY_ESCAPE_PROCESSING(), PROPERTY_LABEL(), PROPERTY_NAME(), PROPERTY_REALNAME(), PROPERTY_TABLENAME(), dbaccess::QUERY, SAL_WARN, SAL_WARN_IF, SelectColumns, STR_WHERE, and Where.
Referenced by impl_getColumnNameOrderBy_throw(), impl_getColumnRealName_throw(), setConditionByColumn(), setStructuredFilter(), and setStructuredHavingClause().
|
overridevirtual |
Definition at line 613 of file SingleSelectQueryComposer.cxx.
References composeStatementFromParts(), and m_aElementaryParts.
|
overridevirtual |
Definition at line 1324 of file SingleSelectQueryComposer.cxx.
References getSQLPart(), m_aAdditiveIterator, comphelper::OMutexAndBroadcastHelper::m_aMutex, and Where.
Referenced by setConditionByColumn().
|
overridevirtual |
Definition at line 1338 of file SingleSelectQueryComposer.cxx.
References getSQLPart(), m_aAdditiveIterator, and comphelper::OMutexAndBroadcastHelper::m_aMutex.
Referenced by appendGroupByColumn().
|
overridevirtual |
Definition at line 1486 of file SingleSelectQueryComposer.cxx.
References connectivity::OSQLParseTreeIterator::getGroupColumns(), GroupByColumns, m_aAdditiveIterator, and setCurrentColumns().
|
overridevirtual |
Definition at line 1345 of file SingleSelectQueryComposer.cxx.
References getSQLPart(), Having, m_aAdditiveIterator, and comphelper::OMutexAndBroadcastHelper::m_aMutex.
|
overridevirtual |
Reimplemented from cppu::ImplHelper5< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 >.
Definition at line 300 of file SingleSelectQueryComposer.cxx.
|
override |
Definition at line 319 of file SingleSelectQueryComposer.cxx.
References comphelper::OPropertyArrayUsageHelper< OSingleSelectQueryComposer >::getArrayHelper().
Referenced by getPropertySetInfo().
|
staticprivate |
retrieves the keyword for the given SQLPart
Definition at line 1870 of file SingleSelectQueryComposer.cxx.
References Group, Having, Order, SAL_WARN, STR_GROUP_BY, STR_HAVING, STR_ORDER_BY, STR_WHERE, and Where.
Referenced by composeStatementFromParts(), getSQLPart(), and setSingleAdditiveClause().
|
overridevirtual |
Definition at line 1331 of file SingleSelectQueryComposer.cxx.
References getSQLPart(), m_aAdditiveIterator, and comphelper::OMutexAndBroadcastHelper::m_aMutex.
Referenced by appendOrderByColumn().
|
overridevirtual |
Definition at line 1491 of file SingleSelectQueryComposer.cxx.
References connectivity::OSQLParseTreeIterator::getOrderColumns(), m_aAdditiveIterator, OrderColumns, and setCurrentColumns().
|
overridevirtual |
Definition at line 1425 of file SingleSelectQueryComposer.cxx.
References connectivity::OSQLParseTreeIterator::getParameters(), getString(), m_aCurrentColumns, comphelper::OMutexAndBroadcastHelper::m_aMutex, m_aSqlIterator, m_xMetaData, ParameterColumns, and PROPERTY_NAME().
Referenced by getColumns().
|
staticprivate |
Definition at line 1115 of file SingleSelectQueryComposer.cxx.
References connectivity::Equal, connectivity::OSQLParseNode::getNodeType(), connectivity::NotEqual, and SAL_WARN.
Referenced by setComparisonPredicate().
|
overridevirtual |
Definition at line 314 of file SingleSelectQueryComposer.cxx.
References getInfoHelper().
|
overridevirtual |
Definition at line 332 of file SingleSelectQueryComposer.cxx.
References connectivity::OSQLParseTreeIterator::getParseTree(), getStatementPart(), comphelper::OMutexAndBroadcastHelper::m_aMutex, and m_aSqlIterator.
Referenced by getQueryWithSubstitution().
|
overridevirtual |
|
private |
returns the part of the select statement
_ePart | Which part should be returned. |
_bWithKeyword | If <TRUE> the keyword will be added too. Otherwise not. |
_rIterator | The iterator to use. |
Definition at line 1894 of file SingleSelectQueryComposer.cxx.
References getKeyword(), connectivity::OSQLParseTreeIterator::getSimpleGroupByTree(), connectivity::OSQLParseTreeIterator::getSimpleHavingTree(), connectivity::OSQLParseTreeIterator::getSimpleOrderTree(), connectivity::OSQLParseTreeIterator::getSimpleWhereTree(), getStatementPart(), Group, Having, Order, SAL_WARN, and Where.
Referenced by getColumns(), getFilter(), getGroup(), getHavingClause(), getOrder(), setElementaryQuery(), and setSingleAdditiveClause().
|
private |
retrieves a particular part of a statement
_rIterator | the iterator to use. |
Definition at line 1514 of file SingleSelectQueryComposer.cxx.
References m_xConnection, and connectivity::OSQLParseNode::parseNodeToStr().
Referenced by getQuery(), getSQLPart(), and getStructuredCondition().
|
private |
getStructuredCondition returns the structured condition for the where or having clause
_aGetFunctor | A member function to get the correct parse node. |
Definition at line 1790 of file SingleSelectQueryComposer.cxx.
References connectivity::OSQLParseNode::absorptions(), connectivity::OSQLParseNode::disjunctiveNormalForm(), connectivity::OSQLParseNode::getChild(), connectivity::OSQLParseTreeIterator::getParseTree(), getStatementPart(), connectivity::OSQLParseTreeIterator::getWhereTree(), m_aAdditiveIterator, m_aContext, comphelper::OMutexAndBroadcastHelper::m_aMutex, m_aPureSelectSQL, m_aSqlParser, m_xConnection, m_xNumberFormatsSupplier, connectivity::OSQLParseNode::negateSearchCondition(), connectivity::OSQLParseNode::parseNodeToStr(), connectivity::OSQLParser::parseTree(), setORCriteria(), connectivity::OSQLParseTreeIterator::setParseTree(), and STR_WHERE.
Referenced by getStructuredFilter(), and getStructuredHavingClause().
|
overridevirtual |
Definition at line 447 of file SingleSelectQueryComposer.cxx.
References connectivity::OSQLParseTreeIterator::getSimpleWhereTree(), and getStructuredCondition().
|
overridevirtual |
Definition at line 441 of file SingleSelectQueryComposer.cxx.
References connectivity::OSQLParseTreeIterator::getSimpleHavingTree(), and getStructuredCondition().
|
private |
Definition at line 1352 of file SingleSelectQueryComposer.cxx.
References connectivity::OSQLParseTreeIterator::getTables(), comphelper::UStringMixLess::isCaseSensitive(), m_aAdditiveIterator, m_pTables, m_xMetaData, PROPERTY_CATALOGNAME(), PROPERTY_NAME(), PROPERTY_SCHEMANAME(), and PROPERTY_TABLENAME().
Referenced by impl_getColumnRealName_throw(), and setConditionByColumn().
|
overridevirtual |
Definition at line 748 of file SingleSelectQueryComposer.cxx.
References connectivity::OSQLParseTreeIterator::getTables(), comphelper::OMutexAndBroadcastHelper::m_aMutex, m_aSqlIterator, m_pTables, and m_xMetaData.
Referenced by setQuery_Impl().
|
overridevirtual |
Reimplemented from cppu::ImplHelper5< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 >.
Definition at line 305 of file SingleSelectQueryComposer.cxx.
References cppu::ImplHelper5< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 >::getTypes().
|
private |
return the name of the column in the query for ORDER BY clause.
That is, for (SELECT a AS b FROM t), it returns "b"
Throws exception if trying to use an unrelated column and the database does not support that.
Definition at line 535 of file SingleSelectQueryComposer.cxx.
References aName, Any, DBA_RES, getColumns(), impl_getColumnRealName_throw(), m_aCurrentColumns, m_xMetaData, PROPERTY_NAME(), SelectColumns, and SQLSTATE_GENERAL.
Referenced by appendOrderByColumn().
|
private |
return the name of the column in the source table.
That is, for (SELECT a AS b FROM t), it returns A or "t"."A", as appropriate.
Use e.g. for WHERE, GROUP BY and HAVING clauses.
bGroupBy | for GROUP BY clause? In that case, throw exception if trying to use an unrelated column and the database does not support that. |
Definition at line 465 of file SingleSelectQueryComposer.cxx.
References aName, Any, DBA_RES, getColumns(), getTableAlias(), m_aCurrentColumns, m_xMetaData, PROPERTY_NAME(), PROPERTY_REALNAME(), PROPERTY_TABLENAME(), SelectColumns, SQLSTATE_GENERAL, and xColumn.
Referenced by appendGroupByColumn(), and impl_getColumnNameOrderBy_throw().
|
inlineprivate |
Definition at line 155 of file SingleSelectQueryComposer.hxx.
References setFilter().
Referenced by appendFilterByColumn().
|
inlineprivate |
Definition at line 156 of file SingleSelectQueryComposer.hxx.
References setHavingClause().
Referenced by appendHavingClauseByColumn().
|
inlinestaticprivate |
Definition at line 68 of file SingleSelectQueryComposer.hxx.
Referenced by composeStatementFromParts(), setElementaryQuery(), setQuery(), and setSingleAdditiveClause().
|
private |
Definition at line 1025 of file SingleSelectQueryComposer.cxx.
References connectivity::OSQLParseNode::count(), connectivity::OSQLParseNode::getChild(), getColumnName(), m_xConnection, NOT, connectivity::OSQLParseNode::parseNodeToStr(), SAL_WARN, setANDCriteria(), setComparisonPredicate(), setLikePredicate(), SQL_ISRULE, and SQL_ISTOKEN.
Referenced by setANDCriteria(), and setORCriteria().
|
overridevirtual |
Definition at line 361 of file SingleSelectQueryComposer.cxx.
References clearCurrentCollections(), Command, dbtools::composeTableNameForSelect(), DBA_RES, DBG_UNHANDLED_EXCEPTION, Exception, comphelper::OMutexAndBroadcastHelper::m_aMutex, m_nCommandType, m_sCommand, m_sOriginal, m_xConnection, m_xConnectionQueries, m_xConnectionTables, PROPERTY_COMMAND(), dbaccess::QUERY, setElementaryQuery(), sMessage, dbaccess::TABLE, and throwGenericSQLException().
|
private |
Definition at line 1210 of file SingleSelectQueryComposer.cxx.
References aName, connectivity::OSQLParseNode::count(), connectivity::Equal, connectivity::OSQLParseNode::getChild(), getColumnName(), connectivity::OSQLParseNode::getNodeType(), getPredicateType(), i, m_aLocale, m_sDecimalSep, m_xConnection, connectivity::NotEqual, nPos, connectivity::OSQLParseNode::parseNodeToPredicateStr(), and SQL_ISRULE.
Referenced by setANDCriteria().
|
private |
Definition at line 1618 of file SingleSelectQueryComposer.cxx.
References aName, Any, aSeq, DBA_RES, getBooleanComparisonPredicate(), getColumns(), getFilter(), dbtools::getSearchColumnFlag(), getTableAlias(), L_BRACKET, m_aContext, m_aCurrentColumns, comphelper::OMutexAndBroadcastHelper::m_aMutex, m_nBoolCompareMode, m_xConnection, m_xMetaData, m_xTypeConverter, nLength, nType, PROPERTY_NAME(), PROPERTY_REALNAME(), PROPERTY_TABLENAME(), PROPERTY_TYPE(), PROPERTY_VALUE(), R_BRACKET, SAL_MAX_INT32, SelectColumns, SQLSTATE_GENERAL, STR_AND, STR_LIKE, STR_OR, cppu::throwException(), u, and xColumn.
Referenced by appendFilterByColumn(), and appendHavingClauseByColumn().
|
private |
Definition at line 1468 of file SingleSelectQueryComposer.cxx.
References getString(), m_aCurrentColumns, comphelper::OMutexAndBroadcastHelper::m_aMutex, m_xMetaData, and PROPERTY_NAME().
Referenced by getGroupColumns(), and getOrderColumns().
|
overridevirtual |
Definition at line 618 of file SingleSelectQueryComposer.cxx.
References clearCurrentCollections(), composeStatementFromParts(), DBG_UNHANDLED_EXCEPTION, Exception, getSQLPart(), incSQLPart(), m_aAdditiveIterator, m_aElementaryParts, comphelper::OMutexAndBroadcastHelper::m_aMutex, m_aSqlIterator, m_aSqlParser, SAL_WARN, setQuery_Impl(), SQLPartCount, and Where.
Referenced by setCommand().
|
overridevirtual |
Definition at line 727 of file SingleSelectQueryComposer.cxx.
References setSingleAdditiveClause(), and Where.
Referenced by implSetFilter(), and setStructuredFilter().
|
overridevirtual |
Definition at line 737 of file SingleSelectQueryComposer.cxx.
References group, and setSingleAdditiveClause().
Referenced by appendGroupByColumn().
|
overridevirtual |
Definition at line 742 of file SingleSelectQueryComposer.cxx.
References Having, and setSingleAdditiveClause().
Referenced by implSetHavingClause(), and setStructuredHavingClause().
|
private |
Definition at line 1144 of file SingleSelectQueryComposer.cxx.
References aName, connectivity::OSQLParseNode::count(), connectivity::OSQLParseNode::getChild(), getColumnName(), i, m_aLocale, m_sDecimalSep, m_xConnection, NOT, connectivity::OSQLParseNode::parseNodeToPredicateStr(), SQL_ISRULE, and SQL_ISTOKEN.
Referenced by setANDCriteria().
|
private |
Definition at line 989 of file SingleSelectQueryComposer.cxx.
References connectivity::OSQLParseNode::count(), connectivity::OSQLParseNode::getChild(), i, setANDCriteria(), setORCriteria(), SQL_ISPUNCTUATION, and SQL_ISRULE.
Referenced by getStructuredCondition(), and setORCriteria().
|
overridevirtual |
Definition at line 732 of file SingleSelectQueryComposer.cxx.
References setSingleAdditiveClause().
Referenced by appendOrderByColumn().
|
overridevirtual |
Definition at line 341 of file SingleSelectQueryComposer.cxx.
References clearCurrentCollections(), incSQLPart(), m_aAdditiveIterator, m_aElementaryParts, comphelper::OMutexAndBroadcastHelper::m_aMutex, m_aSqlParser, m_nCommandType, m_sOriginal, setQuery_Impl(), SQLPartCount, and Where.
|
private |
Definition at line 429 of file SingleSelectQueryComposer.cxx.
References connectivity::OSQLParseTreeIterator::getParseTree(), getTables(), m_aPureSelectSQL, m_aSqlIterator, m_aSqlParser, and m_xConnection.
Referenced by setElementaryQuery(), setQuery(), and setSingleAdditiveClause().
|
private |
sets a single "additive" clause, means a filter/groupby/having/order clause
Definition at line 666 of file SingleSelectQueryComposer.cxx.
References clearColumns(), Exception, getKeyword(), getSQLPart(), GroupByColumns, Having, incSQLPart(), m_aAdditiveIterator, m_aElementaryParts, comphelper::OMutexAndBroadcastHelper::m_aMutex, m_aPureSelectSQL, m_aSqlIterator, m_aSqlParser, OrderColumns, ParameterColumns, SAL_WARN, setQuery_Impl(), SQLPartCount, and Where.
Referenced by setFilter(), setGroup(), setHavingClause(), and setOrder().
|
overridevirtual |
Definition at line 1606 of file SingleSelectQueryComposer.cxx.
References getColumns(), m_aContext, m_aParseContext, m_xConnection, m_xMetaData, and setFilter().
|
overridevirtual |
Definition at line 1612 of file SingleSelectQueryComposer.cxx.
References getColumns(), m_aContext, m_xConnection, m_xMetaData, and setHavingClause().
|
private |
Definition at line 81 of file SingleSelectQueryComposer.hxx.
Referenced by disposing(), getFilter(), getGroup(), getGroupColumns(), getHavingClause(), getOrder(), getOrderColumns(), getStructuredCondition(), getTableAlias(), setElementaryQuery(), setQuery(), and setSingleAdditiveClause().
|
private |
Definition at line 83 of file SingleSelectQueryComposer.hxx.
Referenced by clearColumns(), and clearCurrentCollections().
|
private |
Definition at line 94 of file SingleSelectQueryComposer.hxx.
Referenced by getStructuredCondition(), OSingleSelectQueryComposer(), setConditionByColumn(), setStructuredFilter(), and setStructuredHavingClause().
|
private |
Definition at line 97 of file SingleSelectQueryComposer.hxx.
Referenced by clearColumns(), clearCurrentCollections(), getColumns(), getParameters(), impl_getColumnNameOrderBy_throw(), impl_getColumnRealName_throw(), OSingleSelectQueryComposer(), setConditionByColumn(), and setCurrentColumns().
|
private |
Definition at line 87 of file SingleSelectQueryComposer.hxx.
Referenced by getElementaryQuery(), setElementaryQuery(), setQuery(), and setSingleAdditiveClause().
|
private |
Definition at line 103 of file SingleSelectQueryComposer.hxx.
Referenced by OSingleSelectQueryComposer(), setComparisonPredicate(), and setLikePredicate().
|
private |
Definition at line 78 of file SingleSelectQueryComposer.hxx.
Referenced by OSingleSelectQueryComposer(), and setStructuredFilter().
|
private |
Definition at line 100 of file SingleSelectQueryComposer.hxx.
Referenced by composeStatementFromParts(), getColumns(), getStructuredCondition(), setQuery_Impl(), and setSingleAdditiveClause().
|
private |
Definition at line 80 of file SingleSelectQueryComposer.hxx.
Referenced by disposing(), getColumns(), getParameters(), getQuery(), getQueryWithSubstitution(), getTables(), setElementaryQuery(), setQuery_Impl(), and setSingleAdditiveClause().
|
private |
Definition at line 79 of file SingleSelectQueryComposer.hxx.
Referenced by getColumns(), getQueryWithSubstitution(), getStructuredCondition(), setElementaryQuery(), setQuery(), setQuery_Impl(), and setSingleAdditiveClause().
|
private |
Definition at line 85 of file SingleSelectQueryComposer.hxx.
Referenced by clearCurrentCollections().
|
private |
Definition at line 104 of file SingleSelectQueryComposer.hxx.
Referenced by OSingleSelectQueryComposer(), and setConditionByColumn().
|
private |
Definition at line 105 of file SingleSelectQueryComposer.hxx.
Referenced by getColumns(), setCommand(), and setQuery().
|
private |
Definition at line 98 of file SingleSelectQueryComposer.hxx.
Referenced by clearCurrentCollections(), getTableAlias(), and getTables().
|
private |
Definition at line 102 of file SingleSelectQueryComposer.hxx.
Referenced by getColumns(), and setCommand().
|
private |
Definition at line 101 of file SingleSelectQueryComposer.hxx.
Referenced by OSingleSelectQueryComposer(), setComparisonPredicate(), and setLikePredicate().
|
private |
Definition at line 108 of file SingleSelectQueryComposer.hxx.
Referenced by OSingleSelectQueryComposer(), setCommand(), and setQuery().
|
private |
Definition at line 89 of file SingleSelectQueryComposer.hxx.
Referenced by disposing(), getColumns(), getQueryWithSubstitution(), getStatementPart(), getStructuredCondition(), OSingleSelectQueryComposer(), setANDCriteria(), setCommand(), setComparisonPredicate(), setConditionByColumn(), setLikePredicate(), setQuery_Impl(), setStructuredFilter(), and setStructuredHavingClause().
|
private |
Definition at line 92 of file SingleSelectQueryComposer.hxx.
Referenced by getColumns(), OSingleSelectQueryComposer(), and setCommand().
|
private |
Definition at line 91 of file SingleSelectQueryComposer.hxx.
Referenced by disposing(), OSingleSelectQueryComposer(), and setCommand().
|
private |
Definition at line 90 of file SingleSelectQueryComposer.hxx.
Referenced by getColumns(), getParameters(), getTableAlias(), getTables(), impl_getColumnNameOrderBy_throw(), impl_getColumnRealName_throw(), setConditionByColumn(), setCurrentColumns(), setStructuredFilter(), and setStructuredHavingClause().
|
private |
Definition at line 93 of file SingleSelectQueryComposer.hxx.
Referenced by getStructuredCondition(), and OSingleSelectQueryComposer().
|
private |
Definition at line 95 of file SingleSelectQueryComposer.hxx.
Referenced by setConditionByColumn().