+
+TizenAppId getTizenAppIdByPkgId(const TizenPkgId tzPkgid)
+{
+ LogDebug("Getting TizenAppId by pkgid : " << tzPkgid);
+ SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
+ {
+ WRT_DB_SELECT(select, WidgetInfo, &WrtDatabase::interface())
+ select->Where(Equals<WidgetInfo::tizen_pkgid>(tzPkgid));
+ WidgetInfo::Select::RowList rowList = select->GetRowList();
+
+ if (rowList.empty()) {
+ ThrowMsg(WidgetDAOReadOnly::Exception::WidgetNotExist,
+ "Failed to get widget by handle");
+ }
+ TizenAppId tzAppid = rowList.front().Get_tizen_appid();
+
+ return tzAppid;
+
+ }
+ SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed in getHandle")
+
+}