nistarguy wrote:
1) Page 80, Controlling Insertion and updates.
“If the complete class is immutable, set mutable=”false” in the class mapping”
What is the point of doing this? Wouldn’t declaring all the member variables as final take care of this automatically just using regular Java rules? Or is this so that Hibernate won’t even try to load data twice for the same instance and cause exceptions to be thrown?
Hibernate can make some optimizations if you set the attribute. It's not about loading things twice (this will not happen, since the Session is a cache anyway). Read chapters 4 and 5.
nistarguy wrote:
2) Page 93, Entity and value types.
”In effect, the persistence mechanism implements pass-by-value semantics for some classes.”
I am not sure I understand your term of “pass-by-value persistence.” Could you explain what you mean by that?
The topic is discussed again in chapter 6.
nistarguy wrote:
3) Page 97, Table per concrete class
”In figure 3.7, if the subclasses are all mapped to different tables, a polymorphic association to their superclass (abstract BillingDetails in this example) can’t be represented as a simple foreign key relationship.”
Why not? Could you explain?
Again, covered in more detail in chapter 6. It's quite easy to understand that it doesn't work if you look at the tables for this strategy.
nistarguy wrote:
4) Page 110, discussion regarding cascade=”save-update”
Page 111, bottom of the page, example showing cascade=”all-delete-orphan”.
Wouldn’t both “save-update” and “all-delete-orphan” make inverse=”true” not needed, superfluous attribute (if the other one is specified)? If no, why not?
inverse and cascade are not related at all. Read chapter 4 for cascade and chapters 3 and 6 for inverse.
My best advice is to read at least chapters 3, 4, 5, 6, and 7 to understand Hibernate's core concepts.