ActiveAndroid错误无法从CursorWindow读取第0行,第1列?

时间:2015-06-15 12:42:39

标签: android android-sqlite activeandroid

我正在尝试查询数据库以获取所有Tree个对象但是会引发错误:Failed to read row 0, column -1 from a CursorWindow which has 1021 rows, 15 columns.

Model

@Table(name = "TreeDetails")
public class Tree extends Model {

    public Tree(){
        //Mandatory Empty Constructor
        super();
    }

    @Column(name = "ScientificName")
    public String scientificName;
    public String getScientificName() {
        return scientificName;
    }

    public static List<Tree> getAll(){
        return new Select()
                .from(Tree.class)
                .orderBy("ScientificName Asc")
                .execute();
    }
}

Fragment

public void getTrees(){
        Log.e(TAG, "get trees");

        List<Tree> trees = Tree.getAll();
    }

为什么我收到此错误。数据库中有15列,但我只需要1.列的拼写是ScientificName

0 个答案:

没有答案