20#include <com/sun/star/lang/DisposedException.hpp>
21#include <com/sun/star/lang/XMultiServiceFactory.hpp>
22#include <com/sun/star/sdbc/ColumnSearch.hpp>
23#include <com/sun/star/sdbc/XConnection.hpp>
28#include <com/sun/star/sdb/SQLFilterOperator.hpp>
44using namespace ::
cppu;
49OQueryComposer::OQueryComposer(
const Reference< XConnection>& _xConnection)
52 OSL_ENSURE(_xConnection.is(),
" Connection can't be null!");
54 Reference<XMultiServiceFactory> xFac( _xConnection, UNO_QUERY_THROW );
77 return css::uno::Sequence<sal_Int8>();
82 Any aRet = OSubComponent::queryInterface(rType);
91 return "com.sun.star.sdb.dbaccess.OQueryComposer";
107 ::connectivity::checkDisposed(OSubComponent::rBHelper.bDisposed);
109 ::osl::MutexGuard aGuard(
m_aMutex );
110 Reference<XPropertySet> xProp(
m_xComposer,UNO_QUERY);
119 ::connectivity::checkDisposed(OSubComponent::rBHelper.bDisposed);
121 ::osl::MutexGuard aGuard(
m_aMutex );
130 ::connectivity::checkDisposed(OSubComponent::rBHelper.bDisposed);
139 ::connectivity::checkDisposed(OSubComponent::rBHelper.bDisposed);
148 ::connectivity::checkDisposed(OSubComponent::rBHelper.bDisposed);
156 ::connectivity::checkDisposed(OSubComponent::rBHelper.bDisposed);
158 ::osl::MutexGuard aGuard(
m_aMutex );
166 ::connectivity::checkDisposed(OSubComponent::rBHelper.bDisposed);
167 ::osl::MutexGuard aGuard(
m_aMutex );
182 ::connectivity::checkDisposed(OSubComponent::rBHelper.bDisposed);
183 ::osl::MutexGuard aGuard(
m_aMutex );
198 ::connectivity::checkDisposed(OSubComponent::rBHelper.bDisposed);
200 ::osl::MutexGuard aGuard(
m_aMutex );
214 ::connectivity::checkDisposed(OSubComponent::rBHelper.bDisposed);
216 ::osl::MutexGuard aGuard(
m_aMutex );
220 aOrderCreator.
append(order);
223 if ( !order.isEmpty() )
232 ::connectivity::checkDisposed(OSubComponent::rBHelper.bDisposed);
234 ::osl::MutexGuard aGuard(
m_aMutex );
235 return Reference<XTablesSupplier>(
m_xComposer,UNO_QUERY_THROW)->getTables();
241 ::connectivity::checkDisposed(OSubComponent::rBHelper.bDisposed);
243 ::osl::MutexGuard aGuard(
m_aMutex );
244 return Reference<XColumnsSupplier>(
m_xComposer,UNO_QUERY_THROW)->getColumns();
249 ::connectivity::checkDisposed(OSubComponent::rBHelper.bDisposed);
251 ::osl::MutexGuard aGuard(
m_aMutex );
252 return Reference<XParametersSupplier>(
m_xComposer,UNO_QUERY_THROW)->getParameters();
257 OSubComponent::acquire();
virtual void SAL_CALL release() noexcept override
mutable::osl::Mutex m_aMutex
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
std::vector< OUString > m_aFilters
css::uno::Reference< css::sdb::XSingleSelectQueryComposer > m_xComposerHelper
virtual OUString SAL_CALL getQuery() override
virtual css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > SAL_CALL getStructuredFilter() override
virtual OUString SAL_CALL getImplementationName() override
virtual void SAL_CALL setQuery(const OUString &command) override
virtual void SAL_CALL setFilter(const OUString &filter) override
virtual OUString SAL_CALL getFilter() override
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getColumns() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void SAL_CALL acquire() noexcept override
virtual ~OQueryComposer() override
css::uno::Reference< css::sdb::XSingleSelectQueryComposer > m_xComposer
virtual OUString SAL_CALL getComposedQuery() override
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTables() override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
virtual void SAL_CALL setOrder(const OUString &order) override
std::vector< OUString > m_aOrders
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual void SAL_CALL appendOrderByColumn(const css::uno::Reference< css::beans::XPropertySet > &column, sal_Bool ascending) override
virtual void SAL_CALL release() noexcept override
virtual void SAL_CALL appendFilterByColumn(const css::uno::Reference< css::beans::XPropertySet > &column) override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getParameters() override
virtual OUString SAL_CALL getOrder() override
virtual void SAL_CALL disposing() override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
constexpr OUStringLiteral PROPERTY_ORIGINAL(u"Original")
constexpr OUStringLiteral SERVICE_NAME_SINGLESELECTQUERYCOMPOSER
constexpr OUStringLiteral SERVICE_SDB_SQLQUERYCOMPOSER
OUString getComposedAndClear()
void append(const OUString &lhs)