Hi,
Could somebody please make some enlightenment to this confusing paragraph:
Quote:
Should I use persist() on the Session? The Hibernate Session interface also
features a persist() method. It has the same semantics as the persist()
operation of JPA. However, there’s an important difference between the
two operations with regard to flushing. During synchronization, a Hibernate
Session doesn’t cascade the persist() operation to associated entities
and collections, even if you mapped an association with this option.
It’s only cascaded to entities that are reachable when you call persist()!
Only save() (and update()) are cascaded at flush-time if you use the
Session API. In a JPA application, however, it’s the other way round:
Only persist() is cascaded at flush-time.
-- Java Persistence with Hibernate page 419
I don't understand the sentence in bold face, it seems to contradict its previous statement.
Does this mean hibernate session's persist() method cascades ONLY to reachable entities whereas JPA EntityManager's persist method cascades more further than just reachable entities?
And just what does "entities that are reachable" mean?
Thanks