As of April 12th, you must go to Progress SupportLink to create new support cases or to access existing cases. Please, bookmark the SupportLink URL and use the new portal to contact the support team.
Have you seen our CTO's post about [data modeling in Kinvey](http://www.kinvey.com/blog/3732/data-modeling-in-kinvey "data modeling in Kinvey")? Is there some specific Android topic you wanted more information about?
v
vikash singh
said
about 9 years ago
Hi Caroline,
Thanks for your reply, i seen your CTO's post, and i also see its developer documentation on
Log.d(TAG, "saved data for entity "+ r.getName());
}
});
E
Edward
said
about 9 years ago
Hey,
`KinveyReference`s are used to create a reference between two entities possibly across collections. So, using your data, you could have a `MyEntity` in `Collection_1`, the contains a reference to a `NewEntity` in `Collection_2`.
So, within your `MyEntity`, there is a `private KinveyReference invitations;`, as well as that `initReferences(...)` method.
First, there are a couple issues with that `initReferences(...)` method. It looks like it takes an `InvitationEntity` instead of a `NewEntity`, and assumes the collection is `TestTableWin` instead of `Collection_2`.
then, in the second code snippet, both a `MyEntity` and a `NewEntity` need to be created, and then call `event.initReference(myNewEntit)`, which will set the reference. Then, after that, call save.
05-06 13:55:47.372: W/System.err(3901): at org.pac.mypac.kunvey2.HelloEntity.initReference(HelloEntity.java:117)
05-06 13:55:47.372: W/System.err(3901): at org.pac.mypac.kunvey2.Main.storeDataOnKinvey(Main.java:1028)
05-06 13:55:47.372: W/System.err(3901): at org.pac.mypac.kunvey2.Main$myAsyncTask2.doInBackground(Main.java:137)
is there something wrong in my code ???
E
Edward
said
about 9 years ago
Hey,
The problem is probably that eve2 doesn't have an _id yet.
Before calling appdata.save on event, call it on eve2. Then, after eve2 is saved, in the onSuccess callback, call event.initReference(arg0), and then use appdata to save event.
For these to work, both entities must be saved to your backend, which will create a unique _id for them.
v
vikash singh
said
about 9 years ago
Thanx Edward,
Now data is saving on both Collection(Collection_1, Collection_2).
In collection_1 there are one column name "invitations" which hold these data
vikash singh
1 person has this question