migration and query 4.0

Hi have need migration this query:

String whereClause_Umore = ( "Descrizione LIKE '%Umore:%' and Giorno = "+Data );
        BackendlessDataQuery dataQuery_Umore = new BackendlessDataQuery();
        dataQuery_Umore.setWhereClause( whereClause_Umore );

// fetch restaurants
        Backendless.Data.of( Ariete_desc.class ).find( dataQuery_Umore, new AsyncCallback<BackendlessCollection<Ariete_desc>>()
        {


            @Override
            public void handleResponse( BackendlessCollection<Ariete_desc> restaurants )
            {
                // get first page
                List<Ariete_desc> firstPage = restaurants.getCurrentPage();

                // iterate over the received objects
                Iterator<Ariete_desc> iterator = firstPage.iterator();

                while( iterator.hasNext() )
                {
                    Ariete_desc restaurant = iterator.next();

Domenico,

Did you read the article that I’ve posted in the previous topic? There are two sections that will answer your question (attached an image).

BackendlessDataQuery and Backendless collections are eliminated in v4 of Backendless. They need to be replaced with DataQueryBuilder and native collections.
Here are the docs of how these API currently work:

Examples of ‘find’ with a where clause contain information of how async callback looks like in v4.

Best Regards

Hi anton thanks

Please can send the exmple for while for my code?

thanks

Unfortunately, rewriting client code is not covered by our free support policy. Please take a look at examples that I’ve attached in the previous reply or you may contact sales@backendless.com in order to gain support in rewriting your code for version 4 of Backendless.

Best Regards

Hi mi problem is this



You could explain how to recover the value of a cell called Descrizone
public void handleResponse( List<Fgiorno> foundContacts )
{
    // the "foundContact" collection now contains instances of the Contact class.
    // each instance represents an object stored on the server.
    foundContacts.toString();
    TextView txtdate13 = (TextView) findViewById(R.id.textView);
    txtdate13.setText(foundContacts.toString());
}

Sorry, couldn’t understand what your problem is. Could you please elaborate?

I suppose your variable restaurants should be a response from Backendless. In this case, either rename ‘response’ to ‘restaurants’ or rename the other way.