package com.basic.security.manager.impl.sqlite; import android.text.TextUtils; import com.couchbase.lite.Expression; import com.basic.security.model.ModelAdapter; import java.util.ArrayList; import java.util.List; public class SlIdentityManager extends SlBaseManager { public static List findIdentityList() { return findList("select * from identity "); } public static List findIdentityNameListByPersonId(String personId) { List identityNameList = new ArrayList(); List personPersonIdentity = SlPersonIdentityManager.findPersonIdentityListByPersonId(personId); for (ModelAdapter personIdentity : personPersonIdentity) { String identityId = personIdentity.getString("identity_id"); ModelAdapter identityDocument = findById("identity", identityId); if (identityDocument != null) { String identityName = identityDocument.getString("name"); if (!TextUtils.isEmpty(identityName)) { identityNameList.add(identityName); } } } return identityNameList; } public static ModelAdapter findIdentityById(String id) { return SlBaseManager.findById("identity", id); } }