2015-10-27 17 views
0

由于发布说明提到了日期在0.83中的更改,因此我深入了解是否有人知道该错误是否在更高版本的Realm中得到修复。
或者我只是做错了什么或不寻常的事情。日期列失败0.82.2时为空不确定

问,因为我有很多改变让我的模型移动到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; 
    } 
} 

回答

0

Date字段不能为空在0.82.2,与isNotNull()在一个这样的查询没有任何意义和未实现(其将始终匹配所有对象)。 0.83增加了对空日期的支持。