We use Hibernate 3.x in a Spring application. I have a problem with the order in which the onPostLoad events are being fired. I have an entity called Customer, that contains two other entities Address and Contract Both are a OneToOne relation using the @OneToOne annotation. The Contract entity contains one entity called BankAccount, also as a OneToOne relation. When I load a Customer, the onPostLoad events are fired in this order:
Address
Contract
BankAccount
Customer
which almost makes sense, but the Contract cannot be fully loaded until the loading of the BankAccount has finished. When I look at the Contract entity during the onPostLoad event, the BankAccount within the Contract is there, but it has only the ID populated - all of its fields are set to NULL (yet).
To my understanding, the order should look like:
Address
BankAccount
Contract
Customer
Am I overlooking something?
|