-
Improvement
-
Resolution: Fixed
-
Minor
-
None
-
None
-
None
Rather than have a two-stage
register(subject, bean);
save(subject);
One stop shopping like
registerAndSave(subject, bean);
This would have to
1. check the likely mapping for the bean. If it has a subject property and that conflicts with the given subject, throw an exception. otherwise register (if needed) and save.
2. if no subject property, check that the bean is not registered. If it is, check that it is registered with the given subject. If not, throw an exception. If so save.
Possibly have the following call too
Resource regsiterAndSave(Object bean);
which would return the subject used, conforming to the usual contract for register (find the subject if there is a subject property, create a random one if not)
Next people will want mapAndRegisterAndSave at this rate...