Hi all,
Short Version of Question: Suppose I have an object named Employee. Employ encapsulates other objects such as Address, Supervisor, etc. When changes are made to the Employee and its associations, is the order in which the associated/encapsulated objects stored/flushed predictable or consistent?
More detailed explanation of question: For example, can one always say that the Address will be updated in the database before the Supervisor, and that the Employee is update/saved last? Or is it possible that this occurs sometimes, while others the Supervisor is updated before the Address? I read in the documentation that the order is determined by the order in which session.save is called, but what if I am only calling session.save once on the Employee and the associated entities are set CASCADE ALL? I am trying to detect events via an interceptor. Based on the intercepted event, I need to fire another event into my application. The problem is I need to ensure that the events I fire happen in a predictable order. Any insight is appreciated.
Thanks, Julian
|