2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FAppSqlDataControl.cpp
20 * @brief This is the implementation for the %SqlDataControl class.
23 #include <FAppSqlDataControl.h>
25 #include <FBaseSysLog.h>
26 #include <FBase_NativeError.h>
28 #include "FApp_SqlDataControlImpl.h"
30 using namespace Tizen::Base;
31 using namespace Tizen::Base::Collection;
33 namespace Tizen { namespace App
36 SqlDataControl::SqlDataControl(void)
37 : __pSqlDataControlImpl(null)
39 __pSqlDataControlImpl = new _SqlDataControlImpl;
42 SqlDataControl::~SqlDataControl(void)
44 delete __pSqlDataControlImpl;
48 SqlDataControl::Select(const String& dataId, const IList* pColumnList, const String* pWhere,
49 const String *pOrder, RequestId& reqId, int pageNo, int countPerPage)
51 SysTryReturnResult(NID_APP, __pSqlDataControlImpl, E_INVALID_STATE,
52 "This instance has not been properly constructed.");
54 return __pSqlDataControlImpl->Select(dataId, pColumnList, pWhere, pOrder, reqId, pageNo, countPerPage);
58 SqlDataControl::Insert(const Tizen::Base::String& dataId, const Tizen::Base::Collection::IMap& insertMap,
61 SysTryReturnResult(NID_APP, __pSqlDataControlImpl, E_INVALID_STATE,
62 "This instance has not been properly constructed.");
64 return __pSqlDataControlImpl->Insert(dataId, insertMap, reqId);
68 SqlDataControl::Update(const Tizen::Base::String& dataId, const Tizen::Base::Collection::IMap& updateMap,
69 const Tizen::Base::String* pWhere, RequestId& reqId)
71 SysTryReturnResult(NID_APP, __pSqlDataControlImpl, E_INVALID_STATE, "This instance has not been properly constructed.");
73 return __pSqlDataControlImpl->Update(dataId, updateMap, pWhere, reqId);
77 SqlDataControl::Delete(const Tizen::Base::String& dataId, const Tizen::Base::String* pWhere, RequestId& reqId)
79 SysTryReturnResult(NID_APP, __pSqlDataControlImpl, E_INVALID_STATE,
80 "This instance has not been properly constructed.");
82 return __pSqlDataControlImpl->Delete(dataId, pWhere, reqId);
86 SqlDataControl::SetSqlDataControlResponseListener(ISqlDataControlResponseListener* pListener)
88 SysTryReturnResult(NID_APP, __pSqlDataControlImpl, E_INVALID_STATE,
89 "This instance has not been properly constructed yet.");
91 return __pSqlDataControlImpl->SetSqlDataControlResponseListener(pListener);