21#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
22#include <com/sun/star/sdbc/ColumnSearch.hpp>
23#include <com/sun/star/sdbc/DataType.hpp>
24#include <com/sun/star/sdbc/ColumnValue.hpp>
25#include <com/sun/star/beans/XPropertySet.hpp>
26#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
27#include <com/sun/star/sdbcx/XIndexesSupplier.hpp>
109 aTmp.push_back(aRow);
115 aTmp.push_back(aRow);
119 aTmp.push_back(aRow);
125 aTmp.push_back(aRow);
131 aTmp.push_back(aRow);
138 aTmp.push_back(aRow);
145 aTmp.push_back(aRow);
150 pResult->setRows(std::move(aRows));
155 const Any& ,
const OUString& ,
const OUString& tableNamePattern,
156 const OUString& columnNamePattern )
158 ::osl::MutexGuard aGuard(
m_aMutex );
162 throw SQLException();
164 Reference< XNameAccess> xNames = xTables->getTables();
166 throw SQLException();
174 Sequence< OUString> aTabNames(xNames->getElementNames());
175 const OUString* pTabBegin = aTabNames.getConstArray();
176 const OUString* pTabEnd = pTabBegin + aTabNames.getLength();
177 for(;pTabBegin != pTabEnd;++pTabBegin)
179 if(
match(tableNamePattern,*pTabBegin,
'\0'))
181 Reference< XColumnsSupplier> xTable(
182 xNames->getByName(*pTabBegin), css::uno::UNO_QUERY);
183 OSL_ENSURE(xTable.is(),
"Table not found! Normally an exception had to be thrown here!");
186 Reference< XNameAccess> xColumns = xTable->getColumns();
188 throw SQLException();
190 Sequence< OUString>
aColNames(xColumns->getElementNames());
192 const OUString* pBegin =
aColNames.getConstArray();
193 const OUString* pEnd = pBegin +
aColNames.getLength();
194 Reference< XPropertySet>
xColumn;
195 for(sal_Int32
i=1;pBegin != pEnd;++pBegin,++
i)
197 if(
match(columnNamePattern,*pBegin,
'\0'))
202 xColumns->getByName(*pBegin), css::uno::UNO_QUERY);
203 OSL_ENSURE(
xColumn.is(),
"Columns contains a column who isn't a fastpropertyset!");
210 switch(aRow[5]->
getValue().getInt32())
213 case DataType::VARCHAR:
216 case DataType::LONGVARCHAR:
223 switch(aRow[11]->
getValue().getInt32())
225 case ColumnValue::NO_NULLS:
228 case ColumnValue::NULLABLE:
234 aRows.push_back(aRow);
240 catch (
const WrappedTargetException& e)
243 if (e.TargetException >>= aSql)
245 throw WrappedTargetRuntimeException(e.Message, e.Context, e.TargetException);
248 pResult->setRows(std::move(aRows));
254 const Any& ,
const OUString& ,
const OUString& table,
257 ::osl::MutexGuard aGuard(
m_aMutex );
261 throw SQLException();
263 Reference< XNameAccess> xNames = xTables->getTables();
265 throw SQLException();
273 Reference< XIndexesSupplier> xTable(
274 xNames->getByName(
table), css::uno::UNO_QUERY);
278 Reference< XNameAccess> xIndexes = xTable->getIndexes();
280 throw SQLException();
282 Sequence< OUString> aIdxNames(xIndexes->getElementNames());
284 const OUString* pBegin = aIdxNames.getConstArray();
285 const OUString* pEnd = pBegin + aIdxNames.getLength();
286 Reference< XPropertySet> xIndex;
287 for(;pBegin != pEnd;++pBegin)
289 xIndex.set(xIndexes->getByName(*pBegin), css::uno::UNO_QUERY);
290 OSL_ENSURE(xIndex.is(),
"Indexes contains a column who isn't a fastpropertyset!");
297 auto pIndex =
dynamic_cast<ODbaseIndex*
>(xIndex.get());
304 Reference<XColumnsSupplier> xColumnsSup(xIndex,UNO_QUERY);
305 Reference< XNameAccess> xColumns = xColumnsSup->getColumns();
306 Sequence< OUString>
aColNames(xColumns->getElementNames());
308 const OUString* pColBegin =
aColNames.getConstArray();
309 const OUString* pColEnd = pColBegin +
aColNames.getLength();
310 for(sal_Int32 j=1;pColBegin != pColEnd;++pColBegin,++j)
314 aRows.push_back(aRow);
319 pResult->setRows(std::move(aRows));
325 ::osl::MutexGuard aGuard(
m_aMutex );
366 ::osl::MutexGuard aGuard(
m_aMutex );
ORowSetValueDecorator decorates an ORowSetValue so the value is "refcounted".
virtual css::uno::Reference< css::sdbcx::XTablesSupplier > createCatalog()
const css::uno::Reference< css::ucb::XContent > & getContent() const
mutable::osl::Mutex m_aMutex
css::uno::Any getPropertyValue(const OUString &rPropertyName)
bool getBOOL(const Any &_rAny)
sal_Int32 getINT32(const Any &_rAny)
Reference< XComponentContext > getProcessComponentContext()
OUString getString(const Any &_rAny)
static bool getValue(EContact *pContact, sal_Int32 nColumnNum, GType nType, GValue *pStackValue, bool &_out_rWasNull)
bool match(const sal_Unicode *pWild, const sal_Unicode *pStr, const sal_Unicode cEscape)
#define PROPERTY_ID_ISUNIQUE
#define PROPERTY_ID_ISNULLABLE
#define PROPERTY_ID_PRECISION
#define PROPERTY_ID_TYPENAME
#define PROPERTY_ID_DEFAULTVALUE
#define PROPERTY_ID_SCALE
const Color aColNames[SC_RANGECOLORS]