-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Load de collections
PostPosted: Wed Jan 04, 2006 11:30 am 
Newbie

Joined: Fri Sep 02, 2005 10:21 am
Posts: 11
Location: Fribourg, SWITZERLAND
Hibernate version: 3

Bonjour,

J'ai un problème de mapping de collection.

Lorsque le lance un HQL, la collection associée à ma classe se charge. Très bien c'est ce que je veux!

Code:
List result = session.createQuery(("FROM Discipline")).list() ;

Code:
<hibernate-mapping package="com.unifr.sis.stiftung.business">

   <class name="Discipline" table="STI_DISCIPLINE">

...
      <set name="texts" lazy="false">
         <key column="ID" />
         <one-to-many class="DisciplineLib" />
         <filter name="filDisciplineTexts" condition="LNG=:alLng" />
      </set>
...


Selects générés la première fois:
Code:
Hibernate: select discipline0_.ID as ID from STI_DISCIPLINE discipline0_
select texts0_.ID as ID__, texts0_.LNG as LNG__, texts0_.ID as ID0_, texts0_.LNG as LNG0_, texts0_.LIBELLE as LIBELLE11_0_ from STI_DISCIPLINE_LIB texts0_ where  texts0_.LNG=? and texts0_.ID=?
select texts0_.ID as ID__, texts0_.LNG as LNG__, texts0_.ID as ID0_, texts0_.LNG as LNG0_, texts0_.LIBELLE as LIBELLE11_0_ from STI_DISCIPLINE_LIB texts0_ where  texts0_.LNG=? and texts0_.ID=?
select texts0_.ID as ID__, texts0_.LNG as LNG__, texts0_.ID as ID0_, texts0_.LNG as LNG0_, texts0_.LIBELLE as LIBELLE11_0_ from STI_DISCIPLINE_LIB texts0_ where  texts0_.LNG=? and texts0_.ID=?


Par contre lorsque je relance le HQL, les selects pour remplir la collection ne se relancent pas. J'aimerai les relancer étant donné que j'ai un <filter>.
Select généré la seconde fois:
Code:
select discipline0_.ID as ID from STI_DISCIPLINE discipline0_


Avez-vous une idée?
Merci
Cédric


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 09, 2006 3:31 am 
Newbie

Joined: Fri Sep 02, 2005 10:21 am
Posts: 11
Location: Fribourg, SWITZERLAND
Voici les solutions trouvées:

1) La fermeture de la session règle ce problème

2) Vous avez aussi la possibilité de retirer les instances du cache sessionFactory.evictCollection(C);

Cédric


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.