Certificate email case insensitive

pull/169/head
M66B 5 years ago
parent 1fd7a9f77e
commit ea1b7c0a6d

@ -29,20 +29,16 @@ import java.util.List;
@Dao
public interface DaoCertificate {
@Query("SELECT * FROM certificate" +
" ORDER BY (email = :email) DESC, email, subject")
LiveData<List<EntityCertificate>> liveCertificates(String email);
@Query("SELECT * FROM certificate" +
" WHERE id = :id")
EntityCertificate getCertificate(long id);
" ORDER BY email, subject")
LiveData<List<EntityCertificate>> liveCertificates();
@Query("SELECT * FROM certificate" +
" WHERE fingerprint = :fingerprint" +
" AND email = :email")
" AND email = :email COLLATE NOCASE")
EntityCertificate getCertificate(String fingerprint, String email);
@Query("SELECT * FROM certificate" +
" WHERE email = :email")
" WHERE email = :email COLLATE NOCASE")
List<EntityCertificate> getCertificateByEmail(String email);
@Insert

@ -94,7 +94,7 @@ public class FragmentCertificates extends FragmentBase {
super.onActivityCreated(savedInstanceState);
DB db = DB.getInstance(getContext());
db.certificate().liveCertificates(null).observe(getViewLifecycleOwner(), new Observer<List<EntityCertificate>>() {
db.certificate().liveCertificates().observe(getViewLifecycleOwner(), new Observer<List<EntityCertificate>>() {
@Override
public void onChanged(List<EntityCertificate> certificates) {
if (certificates == null)

Loading…
Cancel
Save