Hibernate version: 3.1.3
We have an immutable table, representing customer data. To add additional, application specific data, we use an optional 'extras' table in a schema which matches section 7.4.2 "A bidirectional one-to-one association on a primary key uses the special id generator".
Using the example from the docs, if the Address doesn't exists for all Persons, then in the TwoPhase load, it attempts to fetch null, one-to-one associations. While this behavior makes sense on hibernate's part, it seems like it should be avoided.
I believe there is even code in the source that's commented out about checking the persistence context if the reference is supposed to be null. We know it's null from the query and within the two-phase load-- yet it attempts to select each one from the optional extras table.
I've thought about using a <join/> instead, but I'm worried about conficts with the immutable status of the parent customer data.
|