-->
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.  [ 1 post ] 
Author Message
 Post subject: Collection Loading problem
PostPosted: Wed Oct 22, 2008 12:22 pm 
Newbie

Joined: Wed Oct 22, 2008 12:11 pm
Posts: 1
Hello,

i have a problem with my collection currentImages.
I see in debug, that the entitys are found and loaded (I added debug messages to constructor and setters), but the collection is not filled with them.

I tried a lot of things, e.g. different collection types, lazy and not lazy
with always the same result.

I mapped ItemImageCurrentBidat with only 1 key BIKEY1 - no success.

what could that be?

best regards

Hibernate version:
3.3.1

Mapping documents:

<hibernate-mapping>
<class name="com.hibernate.persistence.webshop.hostData.Asdat"
mutable="false" table="ASDAT" schema="TEST">
<comment>Artikel-Stamm</comment>
<id name="asanr" type="string">
<column name="ASANR" length="10" />
</id>

<bag name="currentImages" cascade="none" mutable="false" fetch="select" >
<key>
<column name="BIKEY1"></column>
</key>
<one-to-many
class="com.hibernate.persistence.webshop.hostData.ItemImageCurrentBidat" />
</bag>
<bag name="imageTest" cascade="none" mutable="false" lazy="false">
<key>
<column name="BIKEY1"></column>
</key>
<one-to-many
class="com.hibernate.persistence.webshop.hostData.ItemImageTest" />
</bag>
</class>
</hibernate-mapping>


<hibernate-mapping>
<class name="com.hibernate.persistence.webshop.hostData.ItemImageCurrentBidat"
table="CURRENT_IMAGES_BIDAT" schema="TEST">
<comment>additional images view</comment>
<composite-id name="id"
class="com.hibernate.persistence.webshop.hostData.ItemImageId">
<key-property name="bikey1" type="string">
<column name="BIKEY1" length="8" />
</key-property>
<key-property name="bikey2" type="string">
<column name="BIKEY2" length="3" />
</key-property>
<key-property name="bikey3" type="string">
<column name="BIKEY3" length="10" />
</key-property>
</composite-id>
<property name="biext" type="string">
<column name="BIEXT" length="5" />
</property>
<property name="bistand" type="long">
<column name="BISTAND" precision="5" scale="0" />
</property>

</class>
</hibernate-mapping>

The generated SQL (show_sql=true):



22 Okt 2008 18:14:52,696 DEBUG [SQL] select currentima0_.BIKEY1 as BIKEY1_1_, currentima0_.BIKEY2 as BIKEY2_1_, currentima0_.BIKEY3 as BIKEY3_1_, currentima0_.BIKEY1 as BIKEY1_110_0_, currentima0_.BIKEY2 as BIKEY2_110_0_, currentima0_.BIKEY3 as BIKEY3_110_0_, currentima0_.BIEXT as BIEXT110_0_, currentima0_.BISTAND as BISTAND110_0_ from TEST.CURRENT_IMAGES_BIDAT currentima0_ where currentima0_.BIKEY1=?
22 Okt 2008 18:14:52,696 INFO [STDOUT] Hibernate: select currentima0_.BIKEY1 as BIKEY1_1_, currentima0_.BIKEY2 as BIKEY2_1_, currentima0_.BIKEY3 as BIKEY3_1_, currentima0_.BIKEY1 as BIKEY1_110_0_, currentima0_.BIKEY2 as BIKEY2_110_0_, currentima0_.BIKEY3 as BIKEY3_110_0_, currentima0_.BIEXT as BIEXT110_0_, currentima0_.BISTAND as BISTAND110_0_ from TEST.CURRENT_IMAGES_BIDAT currentima0_ where currentima0_.BIKEY1=?
22 Okt 2008 18:14:53,211 TRACE [StringType] binding '248474 ' to parameter: 1
22 Okt 2008 18:14:53,211 TRACE [StringType] binding '248474 ' to parameter: 1
22 Okt 2008 18:14:54,008 DEBUG [AbstractBatcher] about to open ResultSet (open ResultSets: 0, globally: 0)
22 Okt 2008 18:14:54,008 DEBUG [Loader] result set contains (possibly empty) collection: [com.hibernate.persistence.webshop.hostData.Asdat.currentImages#248474 ]
22 Okt 2008 18:14:54,008 TRACE [StringType] returning '248474 ' as column: BIKEY1_110_0_
22 Okt 2008 18:14:54,008 TRACE [StringType] returning '248474 ' as column: BIKEY1_110_0_
22 Okt 2008 18:14:54,008 TRACE [StringType] returning '-01' as column: BIKEY2_110_0_
22 Okt 2008 18:14:54,008 TRACE [StringType] returning '-01' as column: BIKEY2_110_0_
22 Okt 2008 18:14:54,040 TRACE [StringType] returning ' ' as column: BIKEY3_110_0_
22 Okt 2008 18:14:54,040 TRACE [StringType] returning ' ' as column: BIKEY3_110_0_
22 Okt 2008 18:14:54,040 DEBUG [Loader] result row: EntityKey[com.hibernate.persistence.webshop.hostData.ItemImageCurrentBidat#component[bikey1,bikey2,bikey3]{bikey1=248474 , bikey3= , bikey2=-01}]
22 Okt 2008 18:14:54,040 DEBUG [ItemImageCurrentBidat] Consturctor called
22 Okt 2008 18:14:54,040 TRACE [StringType] returning '.jpg ' as column: BIEXT110_0_
22 Okt 2008 18:14:54,040 TRACE [StringType] returning '.jpg ' as column: BIEXT110_0_
22 Okt 2008 18:14:54,040 TRACE [LongType] returning '16150' as column: BISTAND110_0_
22 Okt 2008 18:14:54,040 TRACE [LongType] returning '16150' as column: BISTAND110_0_
22 Okt 2008 18:14:54,040 TRACE [StringType] returning '248474 ' as column: BIKEY1_1_
22 Okt 2008 18:14:54,040 TRACE [StringType] returning '248474 ' as column: BIKEY1_1_
22 Okt 2008 18:14:54,040 DEBUG [Loader] found row of collection: [com.hibernate.persistence.webshop.hostData.Asdat.currentImages#248474 ]


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

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.