hm, cascading would be one option.
i just thought (for the sake of simplicity) it would be cool that whenever i do:
Ebean.save(someSubscription);
all Set Subscription in all classes become invalid, and will be re-fetched on the next call to getSubscription();
or do you think this would have a very bad performance penalty?
consider the following example (some pseudo code, no IDE at hand :) )
------------------------------------
class User {
@Id
Long id;
@OneToMany
Set Subscription subscriptions;
}
class Subscription {
@Id
Long id;
@ManyToOne
User user;
}
main:
User u = getCurrentUser();
Set Subscription s = u.getSubscriptions();
//s contains ids [1,2,3]
Subscription newS = new Subscription();
newS.setUser(u);
Ebean.save(newS);
s = u.getSubscriptions();
//ebean detects that subscriptions are out of date, and refetches them
//s now contains ids [1,2,3,newS.id]
-----------------------------
what do you think?