Failed to create lazy iterator for foreign collection member class

I have a simple master detail, when I query the master and check for a collection of foreign members, throw an exception java.lang.IllegalStateException: Could not build lazy iterator for class com.example.entity.detail

List<Master> masters = DBHelper.getMasterDao().queryForAll();

      

At this point, the masters are retrieved with a fine, but throws an exception when trying to access the foreign member.

Class definition

public class Master {

    public Master(){

    }

    @DatabaseField(id = true)
    public int Id;

    @DatabaseField(format = "yyyy-MM-dd'T'HH:mm:ss", dataType = DataType.DATE_STRING)
    public Date CreationDate;

    // Reverse navigation
    @ForeignCollectionField(eager = true)
    public Collection<detail> details;
}

public class Detail{

    @DatabaseField(id = true)
    public long Id;
    @DatabaseField
    public int Month;
    @DatabaseField
    public double Price;
    @DatabaseField
    public double Diff;

    @DatabaseField(canBeNull = true, foreign = true)
    public Master master;
}

      

+3
java android sqlite ormlite foreign-collection


source to share


No one has answered this question yet

Check out similar questions:

1253
What does "Could not find or load main class" mean?
1152
Iterating over a collection, avoiding ConcurrentModificationException when disposing of objects in a loop
392
Easy way to convert Iterable to collection
eleven
Create table with foreign collection field
4
ORMLite initializes a foreign collection
4
Problems with ORMLite and lazy collections
2
Ormlite Foreign Collections
1
Foreign collection field is not present in db
0
Request object has foreign collections with conditions
0
Android OrmLite Foreign Key / Foreign Collection



All Articles
Loading...
X
Show
Funny
Dev
Pics