greenrobot/greenDAO — Issue #19: Column name escaping missing in where clause 
Author: deradam
Created: 2012-01-30 11:52:14+00:00
State: open

My table contains a column name called "from", which is a reserved keyword in SQL. greenDAO is escaping the column
name (T.'FROM') in the select part but not in the where part. The result is
an exception, see below.

01-27 11:13:25.125: E/MainActivity_(8951):
android.database.sqlite.SQLiteException: near "FROM": syntax error: , while
compiling: SELECT T.'_id',T.'FROM',T.'TO' FROM GUIDANCE T WHERE T.FROM=?
AND T.TO=?
01-27 11:13:25.125: E/MainActivity_(8951): at
android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)
01-27 11:13:25.125: E/MainActivity_(8951): at
android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:92)
01-27 11:13:25.125: E/MainActivity_(8951): at
android.database.sqlite.SQLiteCompiledSql.(SQLiteCompiledSql.java:65)
01-27 11:13:25.125: E/MainActivity_(8951): at
android.database.sqlite.SQLiteProgram.(SQLiteProgram.java:83)
01-27 11:13:25.125: E/MainActivity_(8951): at
android.database.sqlite.SQLiteQuery.(SQLiteQuery.java:49)
01-27 11:13:25.125: E/MainActivity_(8951): at
android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:42)
01-27 11:13:25.125: E/MainActivity_(8951): at
android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1467)
01-27 11:13:25.125: E/MainActivity_(8951): at
android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1435)
01-27 11:13:25.125: E/MainActivity_(8951): at
de.greenrobot.dao.Query.unique(Query.java:108)
01-27 11:13:25.125: E/MainActivity_(8951): at
de.greenrobot.dao.QueryBuilder.unique(QueryBuilder.java:284)
01-27 11:13:25.125: E/MainActivity_(8951): at
info.collide.android.mobilemaze.MainActivity.fetchLocationFromRepository(MainActivity.java:225)