Do you really need a map on the parent? You surely don't need to have 100,00 objects in memory, moreover that you prevent this using the "lazy=extra" attribute, so why bothers trying to map it as a huge collection?
Collections and Maps are a "feature" of hibernate, see:
http://blog.hibernate.org/1395.lace
You could use an hql query to retrieve a particular object and modify this object directly instead of going through a map.
You could design an Helper class or a DAO like this that will behave as you want to instead of using a "Map":
Code:
public class ParentDAO{
private Parent parent;
private Session session;
public ParentDAO(Session session,Parent parent){
this.parent=parent;
}
public void put(String key,Child child){
child.setKey(key);
child.setParent(parent);
session.save(child);
}
public Child get(String key){
return session.createHqlQuery(
" select child from Child child"+
" where child.parent=:parent and child.key=:key" )
.setParameter("parent",parent)
.setParameter("key",key)
.uniqueResult();
}
}