How are column names determined?
i am having issues using Contraints.If i don't use contraints data loads perfectly.But if i try running following query-
Constraint constraint = new Constraint().orderBy("noOfSeen");
List cached = adapter.findAll(database,constraint);
where noOfSeen is the variable of object class.I assumed that the table in [persistence][2] creates column name according to the variable name in object class. but i get following exception
android.database.sqlite.SQLiteException: no such column: noOfSeen (code 1): , while compiling: SELECT * FROM videos ORDER BY noOfSeen
How are column names determined while creating table through this wrapper.How can i use following query of normal database in this wrapper?
"SELECT * FROM " + TABLE_VIDEO +" where " + KEY_TYPE + "='popular'"+ " order by " + KEY_NOSEEN + " DESC "
The column should be snake case: no_of_seen. You can control that by using annotations in the pojo fields.
Are the column names according to the variables used in object classes..and how can we execute where clauses using this library?
The column names are camelized counterparts of the variables, so:
NoOfSeen (POJO) -> no_of_seen (SQLite)
Frederic Yesid Peña Sánchez Web Developer - Designer PHP - MySQL advanced Programmer Tigo proud user IVR
Date: Wed, 11 Mar 2015 12:24:52 -0700 From: [email protected] To: [email protected] Subject: Re: [persistence] How are column names determined? (#10)
Are the column names according to the variables used in object classes..and how can we execute where clauses using this library?
— Reply to this email directly or view it on GitHub.
@bhuvneshvarma There are examples in the README