21#include <com/sun/star/beans/PropertyAttribute.hpp>
22#include <com/sun/star/sdbc/SQLException.hpp>
23#include <com/sun/star/sdbc/DataType.hpp>
24#include <com/sun/star/sdbc/ColumnValue.hpp>
25#include <com/sun/star/sdbc/XRow.hpp>
37using namespace ::
cppu;
41OResultColumn::OResultColumn(
const Reference < XResultSetMetaData >& _xMetaData, sal_Int32 _nPos,
42 const Reference< XDatabaseMetaData >& _rxDBMeta )
44 ,m_xMetaData( _xMetaData )
45 ,m_xDBMetaData( _rxDBMeta )
56 OSL_ENSURE(
m_xDBMetaData.is(),
"OResultColumn::impl_determineIsRowVersion_nothrow: no DBMetaData!" );
70 Reference< XResultSet > xVersionColumns =
m_xDBMetaData->getVersionColumns(
72 if ( xVersionColumns.is() )
74 Reference< XRow > xResultRow( xVersionColumns, UNO_QUERY_THROW );
75 while ( xVersionColumns->next() )
77 if ( xResultRow->getString( 2 ) == sColumnName )
85 catch(
const SQLException&)
102 return css::uno::Sequence<sal_Int8>();
108 return "com.sun.star.sdb.OResultColumn";
119 OColumn::disposing();
128 return new ::cppu::OPropertyArrayHelper
164 template<
typename T >
165 void obtain( Any& _out_rValue, ::std::optional< T > & _rCache,
const sal_Int32 _nPos,
const Reference < XResultSetMetaData >& _rxResultMeta, T (SAL_CALL XResultSetMetaData::*Getter)( sal_Int32 ) )
168 _rCache = (_rxResultMeta.get()->*Getter)(_nPos);
169 _out_rValue <<= *_rCache;
177 if ( OColumn::isRegisteredProperty(
nHandle ) )
179 OColumn::getFastPropertyValue( rValue,
nHandle );
247 OSL_FAIL(
"OResultColumn::getFastPropertyValue: unknown property handle!" );
252 catch (SQLException& )
264 rValue <<= OUString();
284 rValue <<= sal_Int32(0);
287 rValue <<= sal_Int32(DataType::SQLNULL);
290 rValue <<= ColumnValue::NULLABLE_UNKNOWN;
::cppu::IPropertyArrayHelper * getArrayHelper()
css::uno::Type const & get()
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
mutable ::std::optional< sal_Bool > m_isSigned
css::uno::Reference< css::sdbc::XResultSetMetaData > m_xMetaData
void impl_determineIsRowVersion_nothrow()
mutable ::std::optional< sal_Bool > m_isAutoIncrement
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
mutable ::std::optional< sal_Bool > m_bSearchable
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
mutable ::std::optional< sal_Int32 > m_nColumnDisplaySize
css::uno::Reference< css::sdbc::XDatabaseMetaData > m_xDBMetaData
virtual ~OResultColumn() override
mutable ::std::optional< sal_Int32 > m_isNullable
mutable ::std::optional< sal_Bool > m_isReadOnly
mutable ::std::optional< sal_Bool > m_isCaseSensitive
virtual ::cppu::IPropertyArrayHelper * createArrayHelper() const override
mutable ::std::optional< sal_Int32 > m_nPrecision
virtual void SAL_CALL disposing() override
virtual OUString SAL_CALL getImplementationName() override
css::uno::Any m_aIsRowVersion
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
mutable ::std::optional< sal_Bool > m_isWritable
mutable ::std::optional< sal_Int32 > m_nColumnType
mutable ::std::optional< OUString > m_sColumnLabel
mutable ::std::optional< sal_Int32 > m_nScale
mutable ::std::optional< sal_Bool > m_isDefinitelyWritable
mutable ::std::optional< sal_Bool > m_isCurrency
#define DBG_UNHANDLED_EXCEPTION(...)
bool getPropertyValue(ValueType &rValue, css::uno::Reference< css::beans::XPropertySet > const &xPropSet, OUString const &propName)
#define PROPERTY_ID_ISSIGNED
#define PROPERTY_ID_DISPLAYSIZE
#define PROPERTY_ID_ISCASESENSITIVE
#define PROPERTY_ID_ISREADONLY
#define PROPERTY_ID_TABLENAME
#define PROPERTY_ID_SERVICENAME
#define PROPERTY_ID_CATALOGNAME
#define PROPERTY_ID_ISWRITABLE
#define PROPERTY_ID_ISROWVERSION
#define PROPERTY_ID_ISSEARCHABLE
#define PROPERTY_ID_ISNULLABLE
#define PROPERTY_ID_PRECISION
#define PROPERTY_ID_LABEL
#define PROPERTY_ID_SCHEMANAME
#define PROPERTY_ID_ISAUTOINCREMENT
#define PROPERTY_ID_ISCURRENCY
#define PROPERTY_ID_TYPENAME
#define PROPERTY_ID_ISDEFINITELYWRITABLE
#define PROPERTY_ID_SCALE
constexpr OUStringLiteral PROPERTY_ISAUTOINCREMENT(u"IsAutoIncrement")
constexpr OUStringLiteral PROPERTY_ISCURRENCY(u"IsCurrency")
constexpr OUStringLiteral PROPERTY_ISWRITABLE(u"IsWritable")
constexpr OUStringLiteral PROPERTY_PRECISION(u"Precision")
constexpr OUStringLiteral PROPERTY_SERVICENAME(u"ServiceName")
constexpr OUStringLiteral PROPERTY_ISREADONLY(u"IsReadOnly")
constexpr OUStringLiteral PROPERTY_TYPENAME(u"TypeName")
constexpr OUStringLiteral PROPERTY_LABEL(u"Label")
constexpr OUStringLiteral PROPERTY_ISROWVERSION(u"IsRowVersion")
constexpr OUStringLiteral PROPERTY_ISNULLABLE(u"IsNullable")
constexpr OUStringLiteral PROPERTY_SCHEMANAME(u"SchemaName")
constexpr OUStringLiteral PROPERTY_ISDEFINITELYWRITABLE(u"IsDefinitelyWritable")
constexpr OUStringLiteral PROPERTY_SCALE(u"Scale")
constexpr OUStringLiteral SERVICE_SDB_RESULTCOLUMN
constexpr OUStringLiteral PROPERTY_ISSEARCHABLE(u"IsSearchable")
constexpr OUStringLiteral PROPERTY_TABLENAME(u"TableName")
constexpr OUStringLiteral PROPERTY_DISPLAYSIZE(u"DisplaySize")
constexpr OUStringLiteral SERVICE_SDBCX_COLUMN
constexpr OUStringLiteral PROPERTY_CATALOGNAME(u"CatalogName")
constexpr OUStringLiteral PROPERTY_TYPE(u"Type")
constexpr OUStringLiteral PROPERTY_NAME(u"Name")
constexpr OUStringLiteral PROPERTY_ISSIGNED(u"IsSigned")
constexpr OUStringLiteral PROPERTY_ISCASESENSITIVE(u"IsCaseSensitive")