2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file FAppSqlDataControl.cpp
19 * @brief This is the implementation for the %SqlDataControl class.
22 #include <FAppSqlDataControl.h>
24 #include <FBaseSysLog.h>
25 #include <FBase_NativeError.h>
27 #include "FApp_SqlDataControlImpl.h"
29 using namespace Tizen::Base;
30 using namespace Tizen::Base::Collection;
32 namespace Tizen { namespace App
35 SqlDataControl::SqlDataControl(void)
36 : __pSqlDataControlImpl(null)
38 __pSqlDataControlImpl = new _SqlDataControlImpl;
41 SqlDataControl::~SqlDataControl(void)
43 delete __pSqlDataControlImpl;
47 SqlDataControl::Select(const String& dataId, const IList* pColumnList, const String* pWhere,
48 const String *pOrder, RequestId& reqId, int pageNo, int countPerPage)
50 SysTryReturnResult(NID_APP, __pSqlDataControlImpl, E_INVALID_STATE,
51 "This instance has not been properly constructed.");
53 return __pSqlDataControlImpl->Select(dataId, pColumnList, pWhere, pOrder, reqId, pageNo, countPerPage);
57 SqlDataControl::Insert(const Tizen::Base::String& dataId, const Tizen::Base::Collection::IMap& insertMap,
60 SysTryReturnResult(NID_APP, __pSqlDataControlImpl, E_INVALID_STATE,
61 "This instance has not been properly constructed.");
63 return __pSqlDataControlImpl->Insert(dataId, insertMap, reqId);
67 SqlDataControl::Update(const Tizen::Base::String& dataId, const Tizen::Base::Collection::IMap& updateMap,
68 const Tizen::Base::String* pWhere, RequestId& reqId)
70 SysTryReturnResult(NID_APP, __pSqlDataControlImpl, E_INVALID_STATE, "This instance has not been properly constructed.");
72 return __pSqlDataControlImpl->Update(dataId, updateMap, pWhere, reqId);
76 SqlDataControl::Delete(const Tizen::Base::String& dataId, const Tizen::Base::String* pWhere, RequestId& reqId)
78 SysTryReturnResult(NID_APP, __pSqlDataControlImpl, E_INVALID_STATE,
79 "This instance has not been properly constructed.");
81 return __pSqlDataControlImpl->Delete(dataId, pWhere, reqId);
85 SqlDataControl::SetSqlDataControlResponseListener(ISqlDataControlResponseListener* pListener)
87 SysTryReturnResult(NID_APP, __pSqlDataControlImpl, E_INVALID_STATE,
88 "This instance has not been properly constructed yet.");
90 return __pSqlDataControlImpl->SetSqlDataControlResponseListener(pListener);