#175 AndroidDatabaseResults.findColumn not doing case insensitive match for columnName

Latest release
wont-fix
Gray Watson
None
1
2014-08-26
2014-05-29
Farrukh Najmi
No

I did the following call:

List<User> users = userDao.queryForAll();

I got the following stack trace:

Caused by: java.sql.SQLException: Unknown field 'administrationMethod_id' from the Android sqlite cursor, not in:[name, administrationmethod_id, deleted, id]
at com.j256.ormlite.android.AndroidDatabaseResults.findColumn(AndroidDatabaseResults.java:128)
at com.j256.ormlite.field.FieldType.resultToJava(FieldType.java:815)
at com.j256.ormlite.stmt.mapped.BaseMappedQuery.mapRow(BaseMappedQuery.java:60)
at com.j256.ormlite.android.AndroidDatabaseConnection.queryForOne(AndroidDatabaseConnection.java:196)
at com.j256.ormlite.stmt.mapped.MappedQueryForId.execute(MappedQueryForId.java:38)
at com.j256.ormlite.field.FieldType.assignField(FieldType.java:558)
at com.j256.ormlite.stmt.mapped.BaseMappedQuery.mapRow(BaseMappedQuery.java:71)
at com.j256.ormlite.android.AndroidDatabaseConnection.queryForOne(AndroidDatabaseConnection.java:196)
at com.j256.ormlite.stmt.mapped.MappedQueryForId.execute(MappedQueryForId.java:38)
at com.j256.ormlite.field.FieldType.assignField(FieldType.java:558)
at com.j256.ormlite.stmt.mapped.BaseMappedQuery.mapRow(BaseMappedQuery.java:71)
at com.j256.ormlite.stmt.SelectIterator.getCurrent(SelectIterator.java:270)
at com.j256.ormlite.stmt.SelectIterator.nextThrow(SelectIterator.java:161)
at com.j256.ormlite.stmt.StatementExecutor.query(StatementExecutor.java:202)
at com.j256.ormlite.stmt.StatementExecutor.queryForAll(StatementExecutor.java:118)
at com.j256.ormlite.dao.BaseDaoImpl.queryForAll(BaseDaoImpl.java:241)
at com.j256.ormlite.dao.RuntimeExceptionDao.queryForAll(RuntimeExceptionDao.java:108)

The code at com.j256.ormlite.android.AndroidDatabaseResults.findColumn(AndroidDatabaseResults.java:128)

should be doing a case-insensitive match for column name or at least use the exact match for the attribute name in the model class.

Note that model classes are as follows:

User {
Foo1 foo1;
}

Foo1 {
Foo2;
}

Foo3 {
AdministrationMethod administrationMethod;
}

The administrationMethod_id is in table for class Foo 3.

Discussion

  • Farrukh Najmi
    Farrukh Najmi
    2014-05-30

    A proposed fix is available at following PULL request. I would be very grateful for any sense of when this may be in released version.

    https://github.com/j256/ormlite-android/pull/13

     
  • Farrukh Najmi
    Farrukh Najmi
    2014-06-12

    Hi Gray, I would be very grateful for some resolution to this. I have tried to do my part and propose a fix with a Pull Request. TIA.

     
  • Gray Watson
    Gray Watson
    2014-06-13

    Dude, I don't know what to say about this. Others are not having a problem with this and I am less than interested to affecting something as basic as case sensitivity in the core of ORMLite.

    Can you provide a unit test which demonstrates this problem so I can understand it better?

     
    Last edit: Gray Watson 2014-06-13
  • Gray Watson
    Gray Watson
    2014-08-26

    • status: open --> wont-fix
     
  • Gray Watson
    Gray Watson
    2014-08-26

    I'm going to mark this as Wont Fix for now. Please start a conversation on the mailing list if you think this is in error.