-->
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: Problem with map association
PostPosted: Wed Dec 14, 2005 8:09 am 
Newbie

Joined: Mon Jun 06, 2005 8:53 am
Posts: 16
Hi,

I'm having a problem with a map declaration and I don't know if I'm doing something wrong or it's another problem.

I have the following mapping in my User class:

<map name="userProjects" table="USER_PROJECT" cascade="all-delete-orphan">
<key column="serialNum" />
<map-key column="PDOCID" type="string" />
<many-to-many class="Project" />
</map>

The problem is the generated query to populate this map:

select userprojec0_.SERIALNUM as SERIALNUM1_, userprojec0_.elt as elt1_, userprojec0_.PDOCID as PDOCID1_, project1_.PDOCID as PDOCID0_, project1_.VERSION as VERSION38_0_ from omr.USER_PROJECT userprojec0_
inner join omr.PROJECT project1_ on userprojec0_.elt=project1_.PDOCID

I don't know why hibernate is 'selecting a non-existing' column userprojec0_.elt as elt1_

The correct query should be:
select userprojec0_.SERIALNUM as SERIALNUM1_, userprojec0_.PDOCID as PDOCID1_, project1_.PDOCID as PDOCID0_, project1_.VERSION as VERSION38_0_
from omr.USER_PROJECT userprojec0_
inner join omr.PROJECT project1_ on userprojec0_.PDOCID=project1_.PDOCID

Can't I use the same property in the map-key and in the many-to-many?

Thanks,
Cristiane


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.