java - Realm Relationship Many-to-one not work -


i've simple model:

class dog owner owner

and when try add 2 dogs same owner, fist dog i've created owner null , second dog owner.

always owner not null if dog last.

owner me = new owner();  dog doggy = new dog(); doggy.setowner(me);  realm.copytorealmorupdate(doggy);  //here has been created dog doggy , owner me  dog jimmy = new dog();   jimmy.setowner(me);  realm.copytorealmorupdate(jimmy); //here has been created dog jimmy , updated owner me dog jimmy  ....  realmresults<dog> dogs ... dogs.get(0).getowner();   //it's null dogs.get(1).getowner();   //it's owner me 

why not work?

thanks!!


Comments

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -