I’m having difficulties with returning saved objects.
I set the data query to retrieve columns with specific definitions
also I set it ap n instance of Product.class
the result is that the query returned empty.
if I cancel the “whereclause” all class objects are retrieved OK.
It feel like something is missing there and I can’t put the finger on it.
Can you help me?
String search="category = " + " ’ " + last + " ’ ";
String addContry="country = " + “’” + myContry+ " ’ “;
String to=search +” "+ “AND” + " " +addContry;
final String whereClause= to;
Toast.makeText(getActivity().getApplicationContext(),whereClause,Toast.LENGTH_LONG).show();
new Thread(new Runnable() {
@Override
public void run() {
BackendlessDataQuery dataQuery=new BackendlessDataQuery();
dataQuery.setWhereClause(whereClause);
Backendless.Data.of(Product.class).find(dataQuery, new AsyncCallback<BackendlessCollection<Product>>() {
@Override
public void handleResponse(BackendlessCollection<Product> productBackendlessCollection) {
List<Product> first=productBackendlessCollection.getCurrentPage();
Toast.makeText(getActivity().getApplicationContext(), String.valueOf(first.size()),Toast.LENGTH_LONG).show();
}
@Override
public void handleFault(BackendlessFault backendlessFault) {
Toast.makeText(getActivity().getApplicationContext(), backendlessFault.getMessage(),Toast.LENGTH_LONG).show();
}
});