Start a new topic

a ArrayList of a embedded class witch has a reference to a other class.

I have a ArrayList of a embedded class witch has a reference to a other class.

I'm using the following method, but the result do NOT contain the reverend class (Elementos) only a KinveyReference to it.

What I have to do to get each object in the ArrayList elementos using one appData.get ???


Query q = getClient().query();

getClient().appData("Condicoes", Condicoes.class).get(q,new String[]{"elementos"},new KinveyListCallback() {

public class Condicoes extends GenericJson{


private String id;


private ArrayList condicoes;

public static class Condicao extends GenericJson{


private String condicaoId;


private String nome;


private ArrayList elementos;


private KinveyMetaData meta;


private KinveyMetaData.AccessControlList acl; //Kinvey access control, OPTIONAL

. . .


. . .



sorry for the delay in getting back to you--

This looks like an issue with the async library, as it is missing some of the necessary wrappers for accomplishing this. I have opened a ticket and will get a new release out providing these methods.

You need to use the `resolve_depth` flag for resolving kinvey references. It defaults to 1, however you want a value of 2. This field can be used to resolve "embedded" entity's references, up to an arbitrary depth. In your case, you have `Condicoes` which contains `Condicao`. To resolve in the child `Condicao`, that resolve_depth has to equal 2. Does that make sense?

In the meantime, you can use the synchronous blocking API and just wrap the method call in an async task-- for what it's worth, this is what the library does anyways.

private class getWithReferences extends AsyncTask{


protected Condicoes[] doInBackground(Void... params) {

Query q = new Query();

Condicoes[] ret = null;


ret = getClient().appData("Condicoes", Condicoes.class).getBlocking(q, new String[]{"elementos"}, 2, true).execute();

}catch (Exception e){

Log.e("Condicoes", e.getMessage());



return ret;



protected void onPostExecute(Condicoes[] condicoes){

if (condicoes == null){

//an exception has occured during execution


//else it's good to go, so call the method to update your views here.



And then, finally, to execute it, call:

new getWithReferences().execute();


Since a posted this question I changed my code and now I don't have the same class structure. BUT I still have a problem with the getTypedObject. I posted other question

If you could answer this other question would help a lot.

Login or Signup to post a comment