26#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
27#include <com/sun/star/beans/PropertyAttribute.hpp>
39OParseColumn::OParseColumn(
const Reference<XPropertySet>& _xColumn,
bool _bCase)
57 , m_bDbasePrecisionChanged(false)
58 , m_bAggregateFunction(false)
59 , m_bIsSearchable( true )
65OParseColumn::OParseColumn(
const OUString& Name,
66 const OUString& TypeName,
67 const OUString& DefaultValue,
68 const OUString& Description,
76 const OUString& CatalogName,
77 const OUString& SchemaName,
78 const OUString& TableName
95 , m_bDbasePrecisionChanged(false)
96 , m_bAggregateFunction(false)
97 , m_bIsSearchable( true )
104 const Reference< XDatabaseMetaData >& _rxDBMetaData,
const Reference< XNameAccess>& i_xQueryColumns )
106 sal_Int32 nColumnCount = _rxResMetaData->getColumnCount();
110 for ( sal_Int32
i = 1;
i <= nColumnCount; ++
i )
113 aReturn->push_back( pColumn );
114 if ( i_xQueryColumns.is() && i_xQueryColumns->hasByName(pColumn->getRealName()) )
116 Reference<XPropertySet>
xColumn(i_xQueryColumns->getByName(pColumn->getRealName()),UNO_QUERY_THROW);
119 if ( !sLabel.isEmpty() )
120 pColumn->setLabel(sLabel);
129 const Reference< XDatabaseMetaData >& _rxDBMetaData, sal_Int32 _nColumnPos,
StringMap& _rColumns )
131 OUString sLabel = _rxResMetaData->getColumnLabel( _nColumnPos );
134 if(_rColumns.find(sLabel) != _rColumns.end())
136 OUString sAlias(sLabel);
137 sal_Int32 searchIndex=1;
138 while(_rColumns.find(sAlias) != _rColumns.end())
140 sAlias = sLabel + OUString::number(searchIndex++);
144 _rColumns.emplace(sLabel,0);
147 _rxResMetaData->getColumnTypeName( _nColumnPos ),
150 _rxResMetaData->isNullable( _nColumnPos ),
151 _rxResMetaData->getPrecision( _nColumnPos ),
152 _rxResMetaData->getScale( _nColumnPos ),
153 _rxResMetaData->getColumnType( _nColumnPos ),
154 _rxResMetaData->isAutoIncrement( _nColumnPos ),
155 _rxResMetaData->isCurrency( _nColumnPos ),
156 _rxDBMetaData->supportsMixedCaseQuotedIdentifiers(),
157 _rxResMetaData->getCatalogName( _nColumnPos ),
158 _rxResMetaData->getSchemaName( _nColumnPos ),
159 _rxResMetaData->getTableName( _nColumnPos )
161 pColumn->setIsSearchable( _rxResMetaData->isSearchable( _nColumnPos ) );
162 pColumn->setRealName(_rxResMetaData->getColumnName( _nColumnPos ));
163 pColumn->setLabel(sLabel);
189 OSL_ENSURE( !
isNew(),
"OParseColumn::getInfoHelper: a *new* ParseColumn?" );
195 bool _bCase,
bool _bAscending )
211 i_rOriginatingTableName
213 ,m_bAscending(_bAscending)
237 ,m_bAscending(_bAscending)
261 OSL_ENSURE( !
isNew(),
"OOrderColumn::getInfoHelper: a *new* OrderColumn?" );
267 return {
"com.sun.star.sdb.OrderColumn" };
::cppu::IPropertyArrayHelper * getArrayHelper()
void registerProperty(const OUString &_rName, sal_Int32 _nHandle, sal_Int32 _nAttributes, void *_pPointerToMember, const css::uno::Type &_rMemberType)
OOrderColumn(const css::uno::Reference< css::beans::XPropertySet > &_xColumn, const OUString &i_rOriginatingTableName, bool _bCase, bool _bAscending)
virtual void construct() override
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual ~OOrderColumn() override
virtual ::cppu::IPropertyArrayHelper * createArrayHelper() const override
static rtl::Reference< OParseColumn > createColumnForResultSet(const css::uno::Reference< css::sdbc::XResultSetMetaData > &_rxResMetaData, const css::uno::Reference< css::sdbc::XDatabaseMetaData > &_rxDBMetaData, sal_Int32 _nColumnPos, StringMap &_rColumns)
creates a single OParseColumn, as described by a result set meta data instance.
bool m_bAggregateFunction
virtual ::cppu::IPropertyArrayHelper * createArrayHelper() const override
OParseColumn(const css::uno::Reference< css::beans::XPropertySet > &_xColumn, bool _bCase)
static ::rtl::Reference< OSQLColumns > createColumnsForResultSet(const css::uno::Reference< css::sdbc::XResultSetMetaData > &_rxResMetaData, const css::uno::Reference< css::sdbc::XDatabaseMetaData > &_rxDBMetaData, const css::uno::Reference< css::container::XNameAccess > &i_xQueryColumns)
creates a collection of OParseColumn, as described by a result set meta data instance.
virtual void construct() override
virtual ~OParseColumn() override
std::map< OUString, int > StringMap
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
bool m_bDbasePrecisionChanged
::cppu::IPropertyArrayHelper * doCreateArrayHelper() const
helper for derived classes to implement OPropertyArrayUsageHelper::createArrayHelper
bool getBOOL(const Any &_rAny)
sal_Int32 getINT32(const Any &_rAny)
OUString getString(const Any &_rAny)
bool getPropertyValue(ValueType &rValue, css::uno::Reference< css::beans::XPropertySet > const &xPropSet, OUString const &propName)
#define PROPERTY_ID_TABLENAME
#define PROPERTY_ID_DESCRIPTION
#define PROPERTY_ID_DBASEPRECISIONCHANGED
#define PROPERTY_ID_AGGREGATEFUNCTION
#define PROPERTY_ID_CATALOGNAME
#define PROPERTY_ID_ISSEARCHABLE
#define PROPERTY_ID_ISASCENDING
#define PROPERTY_ID_ISNULLABLE
#define PROPERTY_ID_FUNCTION
#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_DEFAULTVALUE
#define PROPERTY_ID_REALNAME
#define PROPERTY_ID_SCALE