22#include <sqlbison.hxx>
64 m_aSQLIterator(_pConnection, _pConnection->createCatalog()->getTables(), m_aParser ),
65 m_pParseTree(nullptr),
66 m_pConnection(_pConnection)
86 if (pParseNode->
count() == 3)
97 else if (
SQL_ISRULE(pParseNode, comparison_predicate))
99 if (pLeft->
isToken() && pRight->isToken())
101 switch (pMiddle->getNodeType())
118 OUString sColumnName,
123 if (pRight->isToken() ||
SQL_ISRULE(pRight, parameter))
125 OUString sMatchString;
127 if (pRight->isToken())
128 sMatchString = pRight->getTokenValue();
132 switch (pMiddle->getNodeType())
148 else if (
SQL_ISRULE(pParseNode, search_condition))
158 else if (
SQL_ISRULE(pParseNode, boolean_term))
171 const OSQLParseNode *pLeft = pParseNode->
getChild(0);
172 const OSQLParseNode* pPart2 = pParseNode->
getChild(1);
173 const OSQLParseNode *pMiddleLeft = pPart2->
getChild(0),
174 *pMiddleRight = pPart2->
getChild(1),
183 OUString sColumnName,
200 else if (
SQL_ISRULE(pParseNode, like_predicate))
204 OUString sColumnName,
209 if (pMiddleRight->isToken() ||
SQL_ISRULE(pMiddleRight, parameter))
211 OUString sMatchString;
213 if (pMiddleRight->isToken())
214 sMatchString = pMiddleRight->getTokenValue();
231 if (
SQL_ISRULE(pParseNode, ordering_spec_commalist))
234 sal_uInt32
n = pParseNode->
count();
237 for (sal_uInt32
i = 0;
i <
n;
i++)
245 else if (
SQL_ISRULE(pParseNode, ordering_spec))
247 if (pParseNode->
count() == 2)
254 if (pColumnRef->
count() == 3)
255 pColumnRef = pColumnRef->
getChild(2);
257 if (pColumnRef->
count() == 1)
259 OUString sColumnName =
286 return xTabs.begin()->first;
299 STR_INVALID_COLUMN_SELECTION
304 pMeta->setMacabFields(xColumns);
312 if (pParseNode !=
nullptr)
317 pParseNode = pParseNode->
getChild(1);
337 if (pParseNode !=
nullptr)
339 if (
SQL_ISRULE(pParseNode, opt_order_by_clause))
341 pParseNode = pParseNode->
getChild(2);
351 Any aRet = MacabCommonStatement_BASE::queryInterface(rType);
352 if (!aRet.hasValue())
368 ::osl::MutexGuard aGuard(
m_aMutex );
377 ::osl::MutexGuard aGuard(
m_aMutex );
385 const OUString&
sql )
387 ::osl::MutexGuard aGuard(
m_aMutex );
396 const OUString&
sql )
398 ::osl::MutexGuard aGuard(
m_aMutex );
406 throw SQLException(aErr, *
this, aErr, 0,
Any());
415 if (sTableName.getLength() != 0)
421 if(aRecords ==
nullptr)
429 pResult->setTableName(sTableName);
454 ::osl::MutexGuard aGuard(
m_aMutex );
463 ::osl::MutexGuard aGuard(
m_aMutex );
472 ::osl::MutexGuard aGuard(
m_aMutex );
480 ::osl::MutexGuard aGuard(
m_aMutex );
490 return new ::cppu::OPropertyArrayHelper
613 MacabCommonStatement_BASE::acquire();
618 MacabCommonStatement_BASE::release();
623 return ::cppu::OPropertySetHelper::createPropertySetInfo(
getInfoHelper());
IMPLEMENT_SERVICE_INFO(MacabStatement, "com.sun.star.sdbc.drivers.MacabStatement", "com.sun.star.sdbc.Statement")
::cppu::IPropertyArrayHelper * getArrayHelper()
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
const OUString & getTokenValue() const
OSQLParseNode * getChild(sal_uInt32 nPos) const
const ::rtl::Reference< OSQLColumns > & getSelectColumns() const
const OSQLTables & getTables() const
void getColumnRange(const OSQLParseNode *_pColumnRef, OUString &_rColumnName, OUString &_rTableRange) const
return the columname and the table range
void setParseTree(const OSQLParseNode *pNewParseTree)
const OSQLParseNode * getOrderTree() const
OSQLStatementType getStatementType() const
void traverseAll()
traverses the complete statement tree, and fills all our data with the information obatined during tr...
const OSQLParseNode * getWhereTree() const
std::unique_ptr< OSQLParseNode > parseTree(OUString &rErrorMessage, const OUString &rStatement, bool bInternational=false)
helper class for accessing resources shared by different libraries in the connectivity module
OUString getResourceString(TranslateId pResId) const
loads a string from the shared resource file
MacabRecords * getMacabRecords()
virtual sal_Bool SAL_CALL execute(const OUString &sql) override
css::sdbc::SQLWarning m_aLastWarning
void selectRecords(MacabResultSet *pResult) const
MacabConnection * m_pConnection
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
virtual void SAL_CALL cancel() override
class MacabOrder * analyseOrderByClause(const OSQLParseNode *pParseNode) const
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
connectivity::OSQLParseNode * m_pParseTree
connectivity::OSQLParser m_aParser
OUString getTableName() const
connectivity::OSQLParseTreeIterator m_aSQLIterator
virtual void SAL_CALL release() noexcept override
void sortRecords(MacabResultSet *pResult) const
virtual ::cppu::IPropertyArrayHelper * createArrayHelper() const override
virtual void getNextParameter(OUString &rParameter) const
virtual void SAL_CALL clearWarnings() override
virtual ~MacabCommonStatement() override
virtual css::uno::Any SAL_CALL getWarnings() override
virtual void resetParameters() const
virtual sal_Bool SAL_CALL convertFastPropertyValue(css::uno::Any &rConvertedValue, css::uno::Any &rOldValue, sal_Int32 nHandle, const css::uno::Any &rValue) override
void setMacabFields(class MacabResultSet *pResult) const
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getConnection() override
virtual void SAL_CALL acquire() noexcept override
virtual sal_Int32 SAL_CALL executeUpdate(const OUString &sql) override
class MacabCondition * analyseWhereClause(const OSQLParseNode *pParseNode) const
css::uno::WeakReference< css::sdbc::XResultSet > m_xResultSet
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual void SAL_CALL close() override
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL executeQuery(const OUString &sql) override
void addOrder(MacabOrder *pOrder)
virtual bool isAlwaysTrue() const =0
MacabAddressBook * getAddressBook() const
MacabHeader * getHeader() const
void sortMacabRecords(const class MacabOrder *pOrder)
void someMacabRecords(const class MacabCondition *pCondition)
virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData() override
MacabStatement(MacabConnection *_pConnection)
mutable::osl::Mutex m_aMutex
OBroadcastHelper & rBHelper
css::uno::Type const & get()
css::uno::Sequence< T > concatSequences(const css::uno::Sequence< T > &rS1, const Ss &... rSn)
Reference< XComponentContext > getComponentContext(Reference< XMultiServiceFactory > const &factory)
::cppu::WeakComponentImplHelper< css::sdbc::XStatement, css::sdbc::XWarningsSupplier, css::util::XCancellable, css::sdbc::XCloseable > MacabCommonStatement_BASE
void impl_throwError(TranslateId pErrorId)
::cppu::ImplInheritanceHelper< MacabCommonStatement, css::lang::XServiceInfo > MacabStatement_BASE
std::map< OUString, OSQLTable, comphelper::UStringMixLess > OSQLTables
void checkDisposed(bool _bThrow)
#define PROPERTY_ID_RESULTSETTYPE
#define PROPERTY_ID_QUERYTIMEOUT
#define PROPERTY_ID_USEBOOKMARKS
#define PROPERTY_ID_CURSORNAME
#define PROPERTY_ID_RESULTSETCONCURRENCY
#define PROPERTY_ID_MAXFIELDSIZE
#define PROPERTY_ID_FETCHSIZE
#define PROPERTY_ID_MAXROWS
#define PROPERTY_ID_ESCAPEPROCESSING
#define PROPERTY_ID_FETCHDIRECTION
#define SQL_ISRULE(pParseNode, eRule)
#define SQL_ISPUNCTUATION(pParseNode, aString)
#define SQL_ISTOKEN(pParseNode, token)