Hi,
i’m trying to create a dynamic query using couchbase lite 2.0.2.
What i’m doing is to add select
, from
and where
dynamically, so i have a method that is like that:
Select select = mSelect.addToQuery();
From from = mFrom.addToQuery(select)
Where where = mWhere.addToQuery(from);
Order orderBy = mOrderBy.addToQuery(where);
Query query = mLimit.addToQuery(orderBy);
and in mSelect.addToQuery()
i’ve got:
public Select addToQuery() {
return QueryBuilder.select(SelectResult.all());
}
but every time i run the query debug shows me:
Method threw 'java.lang.NullPointerException' exception. Cannot evaluate com.couchbase.lite.Select.toString()
The rest of the query elements works without exceptions.
Do you know why is there this error?
If i run a simple full query instead it works, so it should be something related the thing that i’m “creating” the query.
Thanks in advance