Hey guys, a random question came to me the other day. I've got a parent with an ordered bunch of children mapped in a List. Occasionally, I would like to be able to find a child with a specific name. Yes, I know I can use the session.filter() method on the collection, and that's probably what I will end up doing, but another solution occured to me as well. Could the parent map the children both using a List, indexed by position, and using a Map, indexed by name?
If so, could both collections be mapped with cascade="all" or "all-delete-orphan"? Is this pattern particularly bad for any reason?
|