Date列上的isNotNull失败0.82.2

时间:2015-10-27 18:47:59

标签: android realm

我正在寻找是否有人知道错误是否在Realm的更高版本中得到修复,因为发行说明提到了0.83中对Date的更改。
或者我只是做错了什么或与众不同。

要求,因为我有很多变化要让我的模型移动到0.83+才能找到。

这是错误。

D/REALM: Expected columnType 12 or 13, but got 7
D/REALM: jni: ThrowingException 3, ColumnType invalid: expected type_Link or type_LinkList, .
D/REALM: Exception has been throw: Illegal Argument: ColumnType invalid: expected type_Link or type_LinkList

执行以下操作时。

realm.where(Person.class).isNotNull(Person.FIELD_LAST_ACCESS).findAllSorted(Person.FIELD_LAST_ACCESS, false);
Person类的片段

public class Person extends RealmObject {
    @Ignore
    public static String FIELD_LAST_ACCESS = "lastAccess";
    private Date lastAccess;
    public Date getLastAccess() {
        return lastAccess;
    }

    public void setLastAccess(final Date lastAccess) {
        this.lastAccess = lastAccess;
    }
}

1 个答案:

答案 0 :(得分:0)

Date字段在0.82.2中不能为空,因此在isNotNull()上使用viewbox查询没有任何意义并且没有实现(它总是会实现的)匹配所有对象)。在0.83中添加了对空日期的支持。