1*2e2212a7SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*2e2212a7SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*2e2212a7SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*2e2212a7SAndrew Rist * distributed with this work for additional information 6*2e2212a7SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*2e2212a7SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*2e2212a7SAndrew Rist * "License"); you may not use this file except in compliance 9*2e2212a7SAndrew Rist * with the License. You may obtain a copy of the License at 10*2e2212a7SAndrew Rist * 11*2e2212a7SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*2e2212a7SAndrew Rist * 13*2e2212a7SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*2e2212a7SAndrew Rist * software distributed under the License is distributed on an 15*2e2212a7SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*2e2212a7SAndrew Rist * KIND, either express or implied. See the License for the 17*2e2212a7SAndrew Rist * specific language governing permissions and limitations 18*2e2212a7SAndrew Rist * under the License. 19*2e2212a7SAndrew Rist * 20*2e2212a7SAndrew Rist *************************************************************/ 21*2e2212a7SAndrew Rist 22*2e2212a7SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef DBACCESS_CORE_API_WRAPPEDRESULTSET_HXX 25cdf0e10cSrcweir #define DBACCESS_CORE_API_WRAPPEDRESULTSET_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #ifndef DBACCESS_CORE_API_CACHESET_HXX 28cdf0e10cSrcweir #include "CacheSet.hxx" 29cdf0e10cSrcweir #endif 30cdf0e10cSrcweir #include <com/sun/star/sdbc/XRowUpdate.hpp> 31cdf0e10cSrcweir #include <com/sun/star/sdbc/XResultSetUpdate.hpp> 32cdf0e10cSrcweir 33cdf0e10cSrcweir namespace dbaccess 34cdf0e10cSrcweir { 35cdf0e10cSrcweir // this set is used when we have a bookmarkable set from the driver 36cdf0e10cSrcweir class WrappedResultSet : public OCacheSet 37cdf0e10cSrcweir { 38cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XRowLocate> m_xRowLocate; 39cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetUpdate> m_xUpd; 40cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowUpdate> m_xUpdRow; 41cdf0e10cSrcweir 42cdf0e10cSrcweir void updateColumn(sal_Int32 nPos,::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowUpdate > _xParameter,const connectivity::ORowSetValue& _rValue); 43cdf0e10cSrcweir public: WrappedResultSet(sal_Int32 i_nMaxRows)44cdf0e10cSrcweir WrappedResultSet(sal_Int32 i_nMaxRows) : OCacheSet(i_nMaxRows) 45cdf0e10cSrcweir {} ~WrappedResultSet()46cdf0e10cSrcweir ~WrappedResultSet() 47cdf0e10cSrcweir { 48cdf0e10cSrcweir m_xRowLocate = NULL; 49cdf0e10cSrcweir } 50cdf0e10cSrcweir 51cdf0e10cSrcweir virtual void construct(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xDriverSet,const ::rtl::OUString& i_sRowSetFilter); 52cdf0e10cSrcweir virtual void fillValueRow(ORowSetRow& _rRow,sal_Int32 _nPosition); 53cdf0e10cSrcweir // ::com::sun::star::sdbcx::XRowLocate 54cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL getBookmark() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); 55cdf0e10cSrcweir virtual sal_Bool SAL_CALL moveToBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); 56cdf0e10cSrcweir virtual sal_Bool SAL_CALL moveRelativeToBookmark( const ::com::sun::star::uno::Any& bookmark, sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); 57cdf0e10cSrcweir virtual sal_Int32 SAL_CALL compareBookmarks( const ::com::sun::star::uno::Any& first, const ::com::sun::star::uno::Any& second ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); 58cdf0e10cSrcweir virtual sal_Bool SAL_CALL hasOrderedBookmarks( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); 59cdf0e10cSrcweir virtual sal_Int32 SAL_CALL hashBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); 60cdf0e10cSrcweir // ::com::sun::star::sdbcx::XDeleteRows 61cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL deleteRows( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rows ,const connectivity::OSQLTable& _xTable) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); 62cdf0e10cSrcweir // ::com::sun::star::sdbc::XResultSetUpdate 63cdf0e10cSrcweir virtual void SAL_CALL insertRow( const ORowSetRow& _rInsertRow,const connectivity::OSQLTable& _xTable ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); 64cdf0e10cSrcweir virtual void SAL_CALL updateRow(const ORowSetRow& _rInsertRow,const ORowSetRow& _rOrginalRow,const connectivity::OSQLTable& _xTable ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); 65cdf0e10cSrcweir virtual void SAL_CALL deleteRow(const ORowSetRow& _rInsertRow,const connectivity::OSQLTable& _xTable ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); 66cdf0e10cSrcweir virtual void SAL_CALL cancelRowUpdates( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); 67cdf0e10cSrcweir virtual void SAL_CALL moveToInsertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); 68cdf0e10cSrcweir virtual void SAL_CALL moveToCurrentRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); 69cdf0e10cSrcweir }; 70cdf0e10cSrcweir } 71cdf0e10cSrcweir #endif // DBACCESS_CORE_API_WRAPPEDRESULTSET_HXX 72cdf0e10cSrcweir 73