1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: AutoRetrievingBase.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _CONNECTIVITY_AUTOKEYRETRIEVINGBASE_HXX_
31 #define _CONNECTIVITY_AUTOKEYRETRIEVINGBASE_HXX_
33 #include <rtl/ustring.hxx>
34 #include "connectivity/dbtoolsdllapi.hxx"
36 namespace connectivity
38 class OOO_DLLPUBLIC_DBTOOLS OAutoRetrievingBase
40 ::rtl::OUString m_sGeneratedValueStatement
; // contains the statement which should be used when query for automatically generated values
41 sal_Bool m_bAutoRetrievingEnabled
; // set to when we should allow to query for generated values
43 OAutoRetrievingBase() : m_bAutoRetrievingEnabled(sal_False
) {}
44 virtual ~OAutoRetrievingBase(){}
46 inline void enableAutoRetrievingEnabled(sal_Bool _bAutoEnable
) { m_bAutoRetrievingEnabled
= _bAutoEnable
; }
47 inline void setAutoRetrievingStatement(const ::rtl::OUString
& _sStmt
) { m_sGeneratedValueStatement
= _sStmt
; }
49 inline sal_Bool
isAutoRetrievingEnabled() const { return m_bAutoRetrievingEnabled
; }
50 inline const ::rtl::OUString
& getAutoRetrievingStatement() const { return m_sGeneratedValueStatement
; }
52 /** transform the statement to query for auto generated values
53 @param _sInsertStatement
54 The "INSERT" statement, is used to query for column and table names
56 The transformed generated statement.
58 ::rtl::OUString
getTransformedGeneratedStatement(const ::rtl::OUString
& _sInsertStatement
) const;
61 #endif // _CONNECTIVITY_AUTOKEYRETRIEVINGBASE_HXX_