ORMLite get Could not get next result for class 错误

ORMLite get Could not get next result for class Error

我在 android 中使用 ORMlite 库,我随机得到这个错误,我不知道那是什么以及如何修改:

Caused by: java.lang.IllegalStateException: Could not get next result for class [Ljava.lang.String;
            at com.j256.ormlite.stmt.SelectIterator.next

我在使用此方法获取单列时遇到此错误:

    public static List getSingleColumn(String query) {
        List<String> columnes = null;
        try {
            columnes = G.CATEGORY.queryRaw(query, new RawRowMapper<String>() {
                @Override
                public String mapRow(String[] columnNames, String[] resultColumns) throws android.database.SQLException {
                    return resultColumns[0];
                }
            }).getResults();
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return columnes;
    }

或此代码:

List unread_messages = G.DBHELPER.getSingleColumn("SELECT SUM(read_status) FROM messageslist");

尝试将方法更改为:

public static String getSingleColumn(String query) {
    String columnes = null;
    try {
        columnes = G.CATEGORY.queryRaw(query, new RawRowMapper<String>() {
            @Override
            public String mapRow(String[] columnNames, String[] resultColumns) throws android.database.SQLException {
                return resultColumns[0];
            }
        }).getFirstResult();
    } catch (SQLException e) {
        e.printStackTrace();
    }
    return columnes;
}