Lines Matching refs:store
41 * @param store Conditions for split operation
45 int MergerContacts::ContactMerge(std::shared_ptr<OHOS::NativeRdb::RdbStore> store)
47 if (store == nullptr) {
48 HILOG_ERROR("store is empty");
53 std::vector<std::set<int>> candidates = QueryMergeContacts(store, MERGE_MODE_AUTO);
54 int ret = MergeCircle(store, candidates);
58 int MergerContacts::MergeCircle(std::shared_ptr<OHOS::NativeRdb::RdbStore> store, std::vector<std::set<int>> candidates)
74 UpdateRawContacts(store, minId, ids);
76 int error = store->ExecuteSql(sql);
82 matchCandidate.AddHasByRawId(store, minId);
83 matchCandidate.FindMatchContact(store, minId);
94 std::shared_ptr<OHOS::NativeRdb::RdbStore> store, int minId, std::set<int> handledIds)
96 int ret = store->ExecuteSql("PRAGMA foreign_keys = OFF");
115 int code = store->ExecuteSql(sql);
116 ret = store->ExecuteSql("PRAGMA foreign_keys = ON");
124 std::set<int> MergerContacts::HandleIds(std::shared_ptr<OHOS::NativeRdb::RdbStore> store, std::set<int> ids)
144 auto resultSet = store->QuerySql(sqlBuilder);
161 std::shared_ptr<OHOS::NativeRdb::RdbStore> store, int minRawId, std::set<int> Ids)
174 auto resultSet = store->QuerySql(sqlBuilder);
182 UpdateRawContactsExecute(store, minContactId, Ids);
183 DeleteContacts(store, minRawId, Ids);
187 std::shared_ptr<OHOS::NativeRdb::RdbStore> store, int minContactId, std::set<int> Ids)
224 int ret = store->ExecuteSql(updateRawContact);
225 int code = store->ExecuteSql(updateSearchSql);
231 std::string MergerContacts::QueryCandidateName(std::shared_ptr<OHOS::NativeRdb::RdbStore> store, int id)
247 auto resultSet = store->QuerySql(sqlBuilder);
259 std::shared_ptr<OHOS::NativeRdb::RdbStore> store, int rawId, std::set<std::string> data)
278 auto resultSet = store->QuerySql(query);
294 std::shared_ptr<OHOS::NativeRdb::RdbStore> store, int mode)
312 auto resultSet = store->QuerySql(sqlBuilder);
323 UpdateCandidate(store, currentIds, candidates);
327 void MergerContacts::UpdateCandidate(std::shared_ptr<OHOS::NativeRdb::RdbStore> store, std::vector<int> currentIds,
335 std::set<std::string> names = mergeUtils.QueryRawContactByType(store, rawId, nameType);
336 std::set<std::string> phones = mergeUtils.QueryRawContactByType(store, rawId, phoneType);
341 std::set<int> nameIds = QueryTargetName(store, rawId, names);
345 std::set<std::string> otherPhones = mergeUtils.QueryRawContactByType(store, *nameId, phoneType);
358 std::shared_ptr<OHOS::NativeRdb::RdbStore> store)
360 if (store == nullptr) {
361 HILOG_ERROR("MergerContacts SelectCandidate store is nullptr");
406 return store->QuerySql(sql);
412 * @param store Conditions for split operation
418 std::shared_ptr<OHOS::NativeRdb::RdbStore> store, const DataShare::DataSharePredicates &predicates)
429 std::vector<std::set<int>> selectedIds = SelectIdsByName(store, ids);
434 std::set<int> handledIds = HandleIds(store, currentIds);
443 int ret = ManualMergeOperation(store, minId, handledIds);
448 matchCandidate.FindMatchContact(store, minId);
459 std::shared_ptr<OHOS::NativeRdb::RdbStore> store, int minId, std::set<int> handledIds)
461 UpdateRawContacts(store, minId, handledIds);
462 DeleteContacts(store, minId, handledIds);
464 int error = store->ExecuteSql(sql);
473 std::shared_ptr<OHOS::NativeRdb::RdbStore> store, std::set<int> ids)
493 auto resultSet = store->QuerySql(sql);
503 UpdateIdsByName(store, names, ids, selectedIds);
507 void MergerContacts::UpdateIdsByName(std::shared_ptr<OHOS::NativeRdb::RdbStore> store, std::set<std::string> names,
530 auto resultSet = store->QuerySql(sqlBuilder);
543 bool MergerContacts::isNameMatch(std::shared_ptr<OHOS::NativeRdb::RdbStore> store, std::set<int> ids)
547 std::string name = QueryCandidateName(store, it);
560 * @param store Conditions for split operation
565 int MergerContacts::ForceContactMerge(std::shared_ptr<OHOS::NativeRdb::RdbStore> store, std::set<int> ids)
567 if (store == nullptr) {
568 HILOG_ERROR("store is empty");
572 if (isNameMatch(store, ids)) {
573 std::set<int> handledIds = HandleIds(store, ids);
577 UpdateRawContacts(store, minId, handledIds);
578 DeleteContacts(store, minId, handledIds);
593 int error = store->ExecuteSql(sql);