Hibernate version: 3.0
Hi, I'm newbie in Hibernet. I hope someone can help. (Sory by my English).
I have 2 hbm:
This is mappping from ClassA
----------------------------------
<id name="id"
column="id" >
<generator class="sequence">
<param name="sequence">sec_problema_episodio</param>
</generator>
</id>
<property name="zone"
update="true"
insert="true"
column="zone"
not-null="true" />
<many-to-one
name="classB"
class="ClassB"
property-ref="nroHistory"
column="nro_history"
cascade="none"
not-null="true"/>
This is mappping ClassB
-----------------------------
<id name="id"
column="id" >
<generator class="identity"></generator>
</id>
<property name="nroHistory"
update="true"
insert="true"
column="nro_history"
unique="true"
not-null="true" />
So... the problem is that when I get a list of ClassA, for example:
return Hibernation.getSession().createCriteria(ClassA.class)
.add(Restrictions.eq("zone", "A"))
.list();
Hibernate DOES a load for each element of ClassA that the List containt. If the List get ten elements of ClassA, then Hibernate DOES ten load of ClassB.
Why does these loads ?. I didn't need these load.
|