This is a question about the Listing 7.1 in JPH (Revised Edition, 2007), page. 304.
The issue has been raised in this form at:
http://forum.hibernate.org/viewtopic.php?t=968009&highlight=categorizeditem
As pointed out in that post, the CategorizedItem Pojo with its embedded Id is not suited for use where linking may occur between transient Categories/Items.
Christian writes:
Quote:
The pattern gets more complex if you require linking in transient state.
Has anyone got that pattern?
The "collection of components" pattern that follows doesn't work for me because I need bi-directional navigation (frequently, from both sides, so I'm not keen on the using a query in lieu of the bi-directional navigation).
I'm busy trying to work it out myself, but it would be very helpful to know if there is any tried-and-tested approach.
Thanks
Richard