I've just started investigating Hibernate and I have a newbie question.
I am trying to create an empty object, "mark it as persistent", then set the fields, hoping that when the session is flushed, proper insert statement will happen. However, I could not make it working with save or persist methods – it is failing on not null properties. Is this possible and if not, is there a workaround?
The reason why I am trying to do this is that I have a rich client user interface that is setting the properties after an empty object is created. Hibernate is doing a great job of tracking changed (updated) objects, and something similar for inserts would be great. Otherwise I will have to programmatically track new objects and once all properties are set, to call save or persist.
|