What about having the car id in person object and load it as well when loading the person object.
@Entity
public class Person {
@Id Long id;
String name;
Ref<Car> car;
}
@Entity
public class Car {
@Parent Key<Person> owner;
@Id Long id;
String color;
}
public Person get(@Named("id") String webSafeKey) {
Key<Person> key = Key.create(webSafeKey);
Person person= ofy().load().key(key).safe();
return person;
}
And from person object, you can access the car by
Car car = person.car.get();