Kingdom - a long type request returns a class

When querying equalTo fields with a long type, RealmResults returns empty. My request code is as follows:

 _realm.beginTransaction(); long albumID = Long.valueOf(albumId); results = _realm.where(Image.class).equalTo("albumId",albumID).findAll(); _realm.commitTransaction(); 

albumId is the string passed by the method

Image Class:

 public class Image extends RealmObject { @PrimaryKey private long id; private long albumId; private String url; private int width; private int height; private long published; //Setters and getters } 

I tried to query without equalTo and see that the results contain albumId values

+1
source share

All Articles