0
votes

I slightly modified example from the current doc. On saving and entity with Refs that were created from the not saved entitied, do the refs get saved as well? In my case the driver has @Parent - a car.

@Entity
class Car {
    @Id Long id;
    @Load Ref<Person> driver;    // Person is an @Entity
}

Car car = new Car();
car.driver = Ref.create(driver);
ofy().save().entity(car).now();
1

1 Answers

1
votes

No, save operations do not cascade. And load operations only cascade when there is an explicit @Load annotation.

If you want to save the driver as well, do it explicitly.