I have a scenario where objects are created, and should be persisted only if they are modified later on. I could track which objects were created that way myself, but hey, Hibernate is keeping track of the dirty status for me, so I should be able to leverage that dirty checking to drive the decision which newly-created object belongs to the database and which can be silently dropped, right? Besides, Session does not give me a way to check whether a given object is dirty. I'd have to go through unofficial interfaces and risk that my code breaks in future versions of Hibernate to do that.
|