-->
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: Using ordered many-to-many associations with JDK 1.3
PostPosted: Thu Nov 18, 2004 6:37 am 
Newbie

Joined: Fri Oct 22, 2004 6:55 am
Posts: 16
Location: Hamburg, Germany
Hi!

I need to work with many-to-many associations with JDK 1.3. In the documentation I have read that the orderedSet functionality with the order-by attribute (resp. the sort attribute) is only available with JDK 1.4.

Is there a possibility with JDK1.3? In Hibernate in Action, it is mentioned that ordered bags are possible with all JDK versions. But it is not explained how to use them. So, I tried a list:

<list
name="suppliers"
lazy="true"
cascade="none"
table="V_SUPPLER_SITE_X"
>
<meta attribute="field-description">
@hibernate.set
lazy="true"
cascade="none"
table="V_SUPPLER_SITE_X"

@hibernate.collection-key
column="SITE_ID"

@hibernate.collection-many-to-many
class="com.kn.gvs.inv.integration.entities.Supplier"
column="SUPPLIER_ID"
</meta>
<key>
<column name="SITE_ID" />
</key>
<index column="NAME"/>
<many-to-many
class="com.kn.gvs.inv.integration.entities.Supplier"
>
<column name="SUPPLIER_ID" />
</many-to-many>
</list>

This does not work and I get the following error:

...
Caused by: java.sql.SQLException: ORA-00904: "SUPPLIERS0_"."NAME": invalid identifier
...

The SQL statement looks like this:

select
suppliers0_.SITE_ID as SITE_ID__,
suppliers0_.SUPPLIER_ID as SUPPLIER2___,
suppliers0_.NAME as NAME__,
supplier1_.SUPPLIER_ID as SUPPLIER1_0_,
supplier1_.SUPPLIER_NUMBER as SUPPLIER2_0_,
supplier1_.NAME as NAME0_ from V_SUPPLER_SITE_X suppliers0_,
V_SUPPLIER supplier1_
where
suppliers0_.SITE_ID=?
and suppliers0_.SUPPLIER_ID=supplier1_.SUPPLIER_ID

It seems to me that hibernate is searching for the column NAME in the bridge table. I don't know, if the real problem is, that NAME is also a normal property of the entity class. Can anyone help?

Best Regards,
Oliver


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 18, 2004 8:54 am 
Newbie

Joined: Fri Oct 22, 2004 6:55 am
Posts: 16
Location: Hamburg, Germany
Ok, I now found the answer in another thread. It seems that sorting many-to-many associatons is not supported at all.


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.