我的境界中有对象A,B,C。结构是这样的:
public class A extends RealmObject {
...
private B b;
//all setters/getters implemented
}
public class B extends RealmObject {
...
@PrimaryKey
private int id;
private RealmList<C> cs;
//all setter/getters implemented
}
public class C extends RealmObject {
...
private int priority;
//all setter/getters implemented
}
我希望查询 A 对象,并在 C <中 优先级 排序/ em> 类和其他一些成员,所以我这样做:
String[] sortingFields = new String[] {
"b.cs.priority",...
//other fields
};
boolean[] sortingOrders = new boolean[] {
RealmResults.SORT_ORDER_ASCENDING,
...
//respective sorting orders
};
return realm
.where(A.class)
.equalTo("B.id", id)
.findAllSorted(sortingFields, sortingOrders);
当我尝试时,我收到以下错误消息:
java.lang.IllegalArgumentException: Field name 'b.cs.priority' does not exist.
有人可以帮忙告诉我我做错了什么吗?
最佳, Deveti