I want to filter my query results by 2 clauses but I'm not sure how to do it and I can't find clear explanations on how to do so. Below is what I've tried.
termList = SugarRecord.find(Term::class.java, "type = ? AND category = ?", "hcp, "+ parentCategoryId.toString())
Thanks!
For example:
val termList = SugarRecord.find(Term::class.java,
"type = ? and category = ?", // where clause
"hcp", parentCategoryId.toString()) // arguments
Also, you can use Query Builder:
val termList = Select.from(Term::class.java).where(
Condition.prop("type").eq("hcp"), // type =(equals) ?
Condition.prop("category").eq(parentCategoryId.toString())).list()
More info here: http://satyan.github.io/sugar/query.html