-->
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-collection problem
PostPosted: Tue Aug 25, 2009 10:08 am 
Beginner
Beginner

Joined: Fri Feb 10, 2006 8:33 am
Posts: 32
Hi all, see my problem:
Code:
<class name="OpisIdent" table="OPIS_IDENT">
..
..
..
<bag cascade="all-delete-orphan" lazy="false" name="anOpisIdentLiceOrgs">
   <key/>
   <one-to-many class="OpisIdentLiceOrg"/>
  <loader query-ref="test"/>
</bag>
...
...
<sql-query name="test">
    <load-collection alias="alias1" role="OpisIdent.anOpisIdentLiceOrgs"/>
      SELECT oilo.id , oilo.ID_LICE_ORG ,oilo.id_opis_ident ,
         oilo.DATA_BEG ,oilo.DATA_END ,
         nvl(pom.NAIM_ORG,pom.IME||' '|| pom.PREZIME ||' '|| pom.FAMILIA) names, lo.EGN_BULSTAT,lo.TIP
      FROM OPIS_IDENT_LICE_ORG oilo,
              LICA_ORG_OTN_JIVOTNI looj,
              LICA_ORG_POM pom,
              LICA_ORG lo
      WHERE oilo.ID_LICE_ORG=looj.id AND
               looj.ID_LICE_ORG=lo.ID AND
               looj.ID_LICE_ORG = pom.ID_LICA_ORG (+) AND
               pom.pom(+)=1 AND
               oilo.id_opis_ident=?
</sql-query>
...


When I load main class i see that sql-query is executed correctly, all needed data is returned.
But my collection anOpisIdentLiceOrgs is empty.
What is wrong?

Thanks.


Top
 Profile  
 
 Post subject: Re: load-collection problem
PostPosted: Tue Aug 25, 2009 11:15 am 
Beginner
Beginner

Joined: Fri Feb 10, 2006 8:33 am
Posts: 32
The solution:

Code:
<key column="id_opis_ident"/>


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.