我正在寻找是否有人知道错误是否在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);
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;
}
}
答案 0 :(得分:0)
Date
字段在0.82.2中不能为空,因此在isNotNull()
上使用viewbox
查询没有任何意义并且没有实现(它总是会实现的)匹配所有对象)。在0.83中添加了对空日期的支持。