I use ormlite with android and I’ve some poco class.
Example :
public class TableName {
@DatabaseField(id = true)
public Integer id;
@DatabaseField
public String prop;
}
I want to create sometimes
QueryBuilder<TableName, Integer> qb = dao.queryBuilder();
qb.where().eq("prop", "value");
I’d like to validate the “prop” string without using constants in my poco class (like PROPNAME). Do you know a efficiant way to do this ? (without heavy load stuff like reflexion).
I’d really like code validation.
Regards
The ORMLite documentation organizes it this way, to avoid string literals everywhere:
Internally ORMLite uses reflection when you pass this string in, so it is unavoidable when using this library.