emmanuel wrote:
Whether the object has to be updated is a persistance layer topic, but the persistance layer has to know that your object is brand new so it does not need "updates" and must be persisted.
Validation is a vetoe process, just on top of the ORM core.
I think you mean something else than I meant.
Lets take a transient (not yet persisted) Person instance which has a transient Address instance. The transient Address instance has not been touched with setting any attributes after it has been got with new Address(). It has initial values for street, city and so on, whatever the initial values may be.
Then I persist Person with cascading save. But in our ORM the Address is not persisted in the case above. It is only persisted if the dependend transient objects have been "modified" or "touched". Like if street is initially "default", it is required that setStreet("something") was executed. Then the transient Address is "modified" and then it is saved when Person is saved. Otherwise not.
I think Hibernate does not care. It saves Person and Address always if in the mapping file cascading save was set. But our ORM does not so.
I just try to figure out if I am wrong thinking that a ORM should persist "untouched" dependend transient (not yet persisted) objects (provided that the mapping file allowes cascading saves).