I am facing an hibernate session issue. In the DAO class am using Hibernate template to get the data which returns 2 rows. These 2 entities have same foreign key. The issue is first record is retreived successfully where as second record throw "collection is not associated with any session" . I tried adding @Transactional but that didnt help. pls suggest
(List<EntityName>) hibernateTemplate.findByCriteria(detachedCriteria,searchCriteria.getFirstResult(),searchCriteria.getMaxResults());
Collection
<set name="entites" lazy="false" cascade="all" inverse="true">
<key column="Key" not-null="true" property-ref="xxx"/>
<one-to-many class="EntityClass"/>
</set>
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire