SQLiteException
Hey!
Congrats for the new version! :)
Im still trying to use JsonModel in my project...
getting this:
SQLiteException: near "product_audit_id": syntax error (code 1): , while compiling: SELECT * FROM ProductAudit WHERE product_audit_id=1 on load() of JsonModel. I have no clue what's going on.
Please help me!
I resolve issue with this shit:
String primary_key_query = FlowManager.getPrimaryWhereQuery( getTable()).getQuery().split("=")[0] + "=" + primaryKeys[0]; Cursor cursor = new Select() .from(mModelAdapter.getModelClass()) .where(primary_key_query).query();
Please resolve that!!!
Whats the class look like? I could help you if you give me more information on the issue.
I'm getting this error as well in the context of byIds() call.
carmelo-ruota also mentions this in here: https://github.com/Raizlabs/DBFlow/issues/275
It looks like getPrimaryWhereQuery or getPrimaryModelWhere is escaping the column name twice, and it is passed to the SQL engine in double tick-quotes like :
``id``
I have a base class with
@Column String id;
// and then do:
new Select().from(MyClass.class).byIds("123").querySingle()
I believe this error occurs if there is no record with the given condition.
byIds no longer exists, and queries have been improved in 3.0.0, so this wont happen anymore.