Hibernate version: 3.2.6
Name and version of the database you are using: DB2 8.1
Hi,
I have a question regarding the number of queries Hibernate generates when doing an insert.
I have a Class A which has a collection of Class B. When i perform a getHibernateTemplate().save(instanceOfA) and the collection contains 1 instance of B i see the following queries generated:
1: select .. from Table-B
2: insert into Table-A
3: insert into Table-B
4: update Table-B
This is all done within 1 TX but i don't understand why Hibernate generates 4 seperate queries. The hbm.xml of Class A containts:
<set name="B" lazy="false" order-by="column-x asc" cascade="all">
..
Hope someone can clear this up for us.
Thanks,
Maarten
|