ActiveAndroid icon indicating copy to clipboard operation
ActiveAndroid copied to clipboard

Strange problem when querying

Open hsmyy opened this issue 11 years ago • 1 comments

I met a strange problem when I query:

List<A> list = new Select().from(A.class).orderBy("date desc").execute();

Error is:

Failed to read row 0, column 0 from a CursorWindow which has 0 rows, 5 columns.

when I debug the code, I found:

java.lang.IllegalStateException: Couldn't read row 0, col 0 from CursorWindow.  Make sure the Cursor is initialized correctly before accessing data from it.

the sql is:

create table PhotoList(Id integer PRIMARY KEY AUTOINCREMENT, title text, date integer, content text, image blob)

and pojo is like :

@Table(name = "PhotoList", id="Id")
public class A extends Model{
    @Column(name = "title")
    private String title;
    @Column(name = "date")
    private long date;
    @Column(name = "content")
    private String content;
    @Column(name = "image")
    private byte[] imageContent;
}

can you help me solve that or do I need to show more information?

hsmyy avatar Dec 25 '14 08:12 hsmyy

@hsmyy Iam having the same issue so far no solution found.you found the solution ?

ameenmaheen avatar Jan 11 '17 08:01 ameenmaheen