I have a parent object with a lot of different child collections:
Code:
parent
Set<childType1> ...
Set<childType2> ...
Set<childType3> ...
etc.
When I turn org.hibernate.SQL logging to DEBUG and issue the following statements:
Code:
hS.save(oldCo);
hS.getTransaction().commit();
logger.info("all done");
I expect to see the following in the logs and I do:
Code:
DEBUG org.hibernate.SQL::log(401):
insert into db.parent (...) values (...)
But then I immediately see this:
Code:
select ... from
db.childType1 childType10_
where
childType10_.parent_id=?
select ... from
db.childType2 childType20_
where
childType20_.parent_id=?
etc.
INFO myapp.Test::execute(391): all done
Why does it select all the child collections after doing an insert? I thought they were all initialized with Hibernate proxy objects?