summaryrefslogtreecommitdiff
path: root/forms/source/component/cachedrowset.hxx
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2007-11-01 13:56:27 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2007-11-01 13:56:27 +0000
commitbd8ec5acdbab7896f4ad698c9777e32682eaa457 (patch)
tree937e5e789f57d2def688e3e3d575db2c593bcd0c /forms/source/component/cachedrowset.hxx
parentd41793fe11e069b387f03e1b59046f29de6ae223 (diff)
INTEGRATION: CWS dba24b (1.1.2); FILE ADDED
2007/09/03 09:23:05 fs 1.1.2.1: #i76024# helper for a cached row set which does not need to be re-executed when nothing changed
Diffstat (limited to 'forms/source/component/cachedrowset.hxx')
-rw-r--r--forms/source/component/cachedrowset.hxx110
1 files changed, 110 insertions, 0 deletions
diff --git a/forms/source/component/cachedrowset.hxx b/forms/source/component/cachedrowset.hxx
new file mode 100644
index 000000000..5f1620f5c
--- /dev/null
+++ b/forms/source/component/cachedrowset.hxx
@@ -0,0 +1,110 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: cachedrowset.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: hr $ $Date: 2007-11-01 14:56:27 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef CACHEDROWSET_HXX
+#define CACHEDROWSET_HXX
+
+/** === begin UNO includes === **/
+#include <com/sun/star/sdbc/XRowSet.hpp>
+#include <com/sun/star/sdbc/XConnection.hpp>
+/** === end UNO includes === **/
+
+#include <comphelper/componentcontext.hxx>
+
+#include <memory>
+
+//........................................................................
+namespace frm
+{
+//........................................................................
+
+ struct CachedRowSet_Data;
+ //====================================================================
+ //= CachedRowSet
+ //====================================================================
+ class CachedRowSet
+ {
+ public:
+ CachedRowSet( const ::comphelper::ComponentContext& _rContext );
+ ~CachedRowSet();
+
+ public:
+ /** executes the row set
+
+ Since the class is called <code>CachedRowSet</code>, it will cache the
+ row set between the calls. If none of the parameters for the row set
+ changes inbetween, then the row set instance from the previous call will be returned,
+ without re-execution.
+
+ @throws ::com::sun::star::sdbc::SQLException
+ if such an exception is thrown when executing the <code>XRowSet</code>
+ */
+ void execute();
+
+ /// determines whether the row set properties are dirty, i.e. have changed since the last call to execute
+ bool isDirty() const;
+
+ /// disposes the row set instance, and frees all associated resources
+ void dispose();
+
+ /** returns the row set represented by this instance
+
+ If the row set has not been executed before, <NULL/> is returned. If the row set
+ properties are dirty, an old (dirty) instance of the <code>XRowSet</code> is returned.
+ The caller of the method is responsible for preventing those cases.
+ */
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >&
+ getRowSet() const;
+
+ void setDataSource ( const ::rtl::OUString& _rDataSource );
+ void setCommand ( const ::rtl::OUString& _rCommand );
+ void setCommandType ( const sal_Int32 _nCommandType );
+ void setEscapeProcessing ( const sal_Bool _bEscapeProcessing );
+ void setConnection ( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection );
+
+ void setDataSource ( const ::com::sun::star::uno::Any& _rDataSourceValue );
+ void setCommand ( const ::com::sun::star::uno::Any& _rCommandValue );
+ void setEscapeProcessing ( const ::com::sun::star::uno::Any& _rEscapeProcessingValue );
+ void setConnection ( const ::com::sun::star::uno::Any& _rConnectionValue );
+
+ private:
+ ::std::auto_ptr< CachedRowSet_Data > m_pData;
+ };
+
+//........................................................................
+} // namespace frm
+//........................................................................
+
+#endif // CACHEDROWSET_HXX