@ForeignCollectionField(eager = false)
private Collection<Entity> entityCollection ;
我看到我的entityCollection中有一个元素来自ForeignCollectionField
public ArrayList<Entity> getCachedEntityCollection() {
if (entityCollectionArray==null)
{
return new ArrayList<Entity>(entityCollection);
}
return entityCollectionArray;
}
但是当我执行这一行时
return new ArrayList<Entity>(entityCollection);
我得到了这个例外
java.lang.IllegalStateException: Could not get next result for class Entity
at com.j256.ormlite.stmt.SelectIterator.next(SelectIterator.java:183)
at com.j256.ormlite.dao.LazyForeignCollection.toArray(LazyForeignCollection.java:217)
at java.util.ArrayList.<init>(ArrayList.java:97)