23#include <com/sun/star/sdbc/ColumnSearch.hpp>
24#include <com/sun/star/sdbc/DataType.hpp>
25#include <com/sun/star/sdbc/ColumnValue.hpp>
26#include <com/sun/star/sdbc/KeyRule.hpp>
27#include <com/sun/star/sdbc/ProcedureResult.hpp>
28#include <com/sun/star/sdbc/IndexType.hpp>
30#include <com/sun/star/lang/DisposedException.hpp>
31#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
32#include <com/sun/star/sdbc/ResultSetType.hpp>
33#include <com/sun/star/sdbc/FetchDirection.hpp>
52ODatabaseMetaDataResultSet::ODatabaseMetaDataResultSet(ADORecordset* _pRecordSet)
55 ,m_pRecordSet(_pRecordSet)
59 ,m_bOnFirstAfterOpen(false)
66 VARIANT_BOOL bIsAtBOF;
97 return aRet.hasValue() ? aRet : ODatabaseMetaDataResultSet_BASE::queryInterface(rType);
106 return ::comphelper::concatSequences(
aTypes.getTypes(),ODatabaseMetaDataResultSet_BASE::getTypes());
118 ::osl::MutexGuard aGuard(
m_aMutex );
119 checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
123 sal_Int32 nLen = xMeta->getColumnCount();
127 if(xMeta->isCaseSensitive(
i) ?
columnName == xMeta->getColumnName(
i) :
128 columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(
i)))
136#define BLOCK_SIZE 256
140 ::osl::MutexGuard aGuard(
m_aMutex );
141 checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
162 HRESULT
hr = ::SafeArrayGetElement(
m_aValue.parray,&index2,&chData);
190 ::osl::MutexGuard aGuard(
m_aMutex );
204 ::osl::MutexGuard aGuard(
m_aMutex );
247 ::osl::MutexGuard aGuard(
m_aMutex );
281 ::osl::MutexGuard aGuard(
m_aMutex );
282 checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
322 ::osl::MutexGuard aGuard(
m_aMutex );
323 checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
335 ::osl::MutexGuard aGuard(
m_aMutex );
344 return static_cast<sal_Int16
>((*m_aValueRangeIter).second[
m_aValue.
getInt32()]);
346 return static_cast<sal_Int16
>((*m_aStrValueRangeIter).second[
m_aValue.
getString()]);
354 ::osl::MutexGuard aGuard(
m_aMutex );
383 ::osl::MutexGuard aGuard(
m_aMutex );
384 checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
389 VARIANT_BOOL bIsAtEOF;
391 return bIsAtEOF == VARIANT_TRUE;
396 ::osl::MutexGuard aGuard(
m_aMutex );
397 checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
407 ::osl::MutexGuard aGuard(
m_aMutex );
408 checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
418 ::osl::MutexGuard aGuard(
m_aMutex );
419 checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
430 ::osl::MutexGuard aGuard(
m_aMutex );
431 checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
445 ::osl::MutexGuard aGuard(
m_aMutex );
446 checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
455 ::osl::MutexGuard aGuard(
m_aMutex );
456 checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
471 ::osl::MutexGuard aGuard(
m_aMutex );
472 checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
480 ::osl::MutexGuard aGuard(
m_aMutex );
481 checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
498 ::osl::MutexGuard aGuard(
m_aMutex );
499 checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
515 ::osl::MutexGuard aGuard(
m_aMutex );
516 checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
536 ::osl::MutexGuard aGuard(
m_aMutex );
537 checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
544 return (RecordStatusEnum(eRec) & adRecDeleted) == adRecDeleted;
548{ ::osl::MutexGuard aGuard(
m_aMutex );
549 checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
556 return (RecordStatusEnum(eRec) & adRecNew) == adRecNew;
561 ::osl::MutexGuard aGuard(
m_aMutex );
562 checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
569 return (RecordStatusEnum(eRec) & adRecModified) == adRecModified;
575 ::osl::MutexGuard aGuard(
m_aMutex );
576 checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
582 VARIANT_BOOL bIsAtBOF;
584 return bIsAtBOF == VARIANT_TRUE;
590 ::osl::MutexGuard aGuard(
m_aMutex );
591 checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
609 ::osl::MutexGuard aGuard(
m_aMutex );
610 checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
620 ::osl::MutexGuard aGuard(
m_aMutex );
621 checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
632 ::osl::MutexGuard aGuard(
m_aMutex );
633 checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
652 return ResultSetConcurrency::READ_ONLY;
657 return ResultSetType::FORWARD_ONLY;
662 return FetchDirection::FORWARD;
693 return new ::cppu::OPropertyArrayHelper
736 Any & rConvertedValue,
746 throw css::lang::IllegalArgumentException();
748 return ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue,
getFetchDirection());
750 return ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue,
getFetchSize());
769 throw Exception(
"cannot set prop " + OUString::number(nHandle),
nullptr);
771 OSL_FAIL(
"setFastPropertyValue_NoBroadcast: Illegal handle value!");
802 for(sal_Int32
i=1;
i<4;
i++)
810 ::std::map<sal_Int32,sal_Int32>
aMap
812 {DB_PT_UNKNOWN, ProcedureResult::UNKNOWN},
813 {DB_PT_PROCEDURE, ProcedureResult::NONE},
814 {DB_PT_FUNCTION, ProcedureResult::RETURN}
819 pMetaData->setProceduresMap();
849 pMetaData->setColumnPrivilegesMap();
856 for(sal_Int32
i=1;
i<5;++
i)
877 ::std::map<sal_Int32,sal_Int32>
aMap {
920 std::map< sal_Int32,OUString> aMap2 {
927 pMetaData->setColumnsMap();
934 for(sal_Int32
i=1;
i<5;
i++)
939 pMetaData->setTablesMap();
946 for(sal_Int32
i=1;
i<5;
i++)
958 ::std::map<sal_Int32,sal_Int32>
aMap
960 {DBTYPE_EMPTY, DataType::SQLNULL},
961 {DBTYPE_NULL, DataType::SQLNULL},
962 {DBTYPE_I2, DataType::SMALLINT},
963 {DBTYPE_I4, DataType::INTEGER},
964 {DBTYPE_R4, DataType::FLOAT},
965 {DBTYPE_R8, DataType::DOUBLE},
966 {DBTYPE_CY, DataType::BIGINT},
967 {DBTYPE_DATE, DataType::DATE},
968 {DBTYPE_BSTR, DataType::VARCHAR},
969 {DBTYPE_IDISPATCH, DataType::OBJECT},
970 {DBTYPE_ERROR, DataType::OTHER},
971 {DBTYPE_BOOL, DataType::BIT},
972 {DBTYPE_VARIANT, DataType::STRUCT},
973 {DBTYPE_IUNKNOWN, DataType::OTHER},
974 {DBTYPE_DECIMAL, DataType::DECIMAL},
975 {DBTYPE_UI1, DataType::TINYINT},
976 {DBTYPE_ARRAY, DataType::ARRAY},
977 {DBTYPE_BYREF, DataType::REF},
978 {DBTYPE_I1, DataType::CHAR},
979 {DBTYPE_UI2, DataType::SMALLINT},
980 {DBTYPE_UI4, DataType::INTEGER},
984 {DBTYPE_I8, DataType::BIGINT},
985 {DBTYPE_UI8, DataType::BIGINT},
986 {DBTYPE_GUID, DataType::OTHER},
987 {DBTYPE_VECTOR, DataType::OTHER},
988 {DBTYPE_FILETIME, DataType::OTHER},
989 {DBTYPE_RESERVED, DataType::OTHER},
992 {DBTYPE_BYTES, DataType::VARBINARY},
993 {DBTYPE_STR, DataType::LONGVARCHAR},
994 {DBTYPE_WSTR, DataType::LONGVARCHAR},
995 {DBTYPE_NUMERIC, DataType::NUMERIC},
996 {DBTYPE_UDT, DataType::OTHER},
997 {DBTYPE_DBDATE, DataType::DATE},
998 {DBTYPE_DBTIME, DataType::TIME},
999 {DBTYPE_DBTIMESTAMP, DataType::TIMESTAMP},
1000 {DBTYPE_HCHAPTER, DataType::OTHER},
1001 {DBTYPE_PROPVARIANT, DataType::OTHER},
1002 {DBTYPE_VARNUMERIC, DataType::NUMERIC}
1008 pMetaData->setProcedureColumnsMap();
1022 pMetaData->setProcedureColumnsMap();
1043 ::std::map<sal_Int32,sal_Int32>
aMap
1045 { DBPROPVAL_IT_HASH, IndexType::HASHED },
1046 { DBPROPVAL_IT_CONTENT, IndexType::OTHER },
1047 { DBPROPVAL_IT_OTHER, IndexType::OTHER },
1048 { DBPROPVAL_IT_BTREE, IndexType::OTHER }
1053 ::std::map<sal_Int32,sal_Int32> aMap2
1060 std::map< sal_Int32,OUString> aMap3
1063 { DB_COLLATION_ASC,
"A" },
1064 { DB_COLLATION_DESC,
"D" }
1070 pMetaData->setIndexInfoMap();
1085 std::map< sal_Int32,OUString>
aMap
1094 pMetaData->setTablePrivilegesMap();
1114 std::map< OUString,sal_Int32>
aMap
1116 {
"CASCADE", KeyRule::CASCADE },
1117 {
"RESTRICT", KeyRule::RESTRICT },
1118 {
"SET NULL", KeyRule::SET_NULL },
1119 {
"SET DEFAULT", KeyRule::SET_DEFAULT },
1120 {
"NO ACTION", KeyRule::NO_ACTION }
1127 pMetaData->setCrossReferenceMap();
1137 std::map< OUString,sal_Int32> aMap1 { { OUString(), 10 } };
1141 ::std::map<sal_Int32,sal_Int32>
aMap
1187 ::std::map<sal_Int32,sal_Int32> aColumnValueMapping
1189 { VARIANT_FALSE, ColumnValue::NO_NULLS },
1190 { VARIANT_TRUE, ColumnValue::NULLABLE }
1196 ::std::map<sal_Int32,sal_Int32> aSearchMapping
1198 { DB_UNSEARCHABLE, ColumnSearch::NONE },
1199 { DB_LIKE_ONLY, ColumnSearch::CHAR },
1200 { DB_ALL_EXCEPT_LIKE, ColumnSearch::BASIC },
1201 { DB_SEARCHABLE, ColumnSearch::FULL }
1206 ::std::map<sal_Int32,sal_Int32> aCurrencyMapping;
1210 pMetaData->setTypeInfoMap();
1216 ODatabaseMetaDataResultSet_BASE::acquire();
1221 ODatabaseMetaDataResultSet_BASE::release();
1226 return ::cppu::OPropertySetHelper::createPropertySetInfo(
getInfoHelper());
1231 ::osl::MutexGuard aGuard(
m_aMutex );
1232 checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed);
::cppu::IPropertyArrayHelper * getArrayHelper()
void disposing(std::unique_lock< std::mutex > &rGuard)
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
static sal_Int32 MapADOType2Jdbc(DataTypeEnum eType)
static WpADOField getField(ADORecordset *_pRecordSet, sal_Int32 _nColumnIndex)
css::util::Date getDate() const
OUString getString() const
css::util::DateTime getDateTime() const
css::util::Time getTime() const
css::uno::Sequence< sal_Int8 > getByteSequence() const
sal_Int32 getInt32() const
sal_Int16 getInt16() const
OLEVariant GetChunk(long Length) const
void get_Value(OLEVariant &aValVar) const
sal_Int32 GetActualSize() const
sal_Int32 GetAttributes() const
mutable::osl::Mutex m_aMutex
css::uno::Type const & get()
constexpr OUStringLiteral aData
::cppu::WeakComponentImplHelper< css::sdbc::XResultSet, css::sdbc::XRow, css::sdbc::XResultSetMetaDataSupplier, css::util::XCancellable, css::sdbc::XWarningsSupplier, css::sdbc::XCloseable, css::sdbc::XColumnLocate > ODatabaseMetaDataResultSet_BASE
void checkDisposed(bool _bThrow)
HashMap_OWString_Interface aMap
#define PROPERTY_ID_RESULTSETTYPE
#define PROPERTY_ID_CURSORNAME
#define PROPERTY_ID_RESULTSETCONCURRENCY
#define PROPERTY_ID_FETCHSIZE
#define PROPERTY_ID_FETCHDIRECTION