-->
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: getting exception: No column name found for property....
PostPosted: Fri Jan 30, 2004 2:48 pm 
Newbie

Joined: Fri Jan 16, 2004 9:32 am
Posts: 11
Hello.

I have a class called SubscriptionBean...It has two keys - partyID and contentID. My mapping is shown below:

<class name="com.ci.db.member.SubscriptionBean" table="SUBSCRIPTION">
<composite-id>
<key-property name="partyID" type="long" >
<column name="PARTY_ID" sql-type="integer" not-null="false"/>
</key-property>
<key-property name="contentID" type="integer" >
<column name="CONTENT_ID" sql-type="integer" not-null="false"/>
</key-property>
</composite-id>
<property name="subscribed">
<column name="SUBSCRIBED" sql-type="integer" not-null="true"/>
</property>
</class>

(I assume my usage of composite-id is correct?)

Next I wrote a named query to access SubscriptionBean. Essentially it joins the subscription table with the party table:

<sql-query name="subscribedContentQuery">
<return alias="sub" class="com.ci.db.member.SubscriptionBean"/>
select {sub}.party_id as {sub.partyID},
{sub}.content_id as {sub.contentID},
{sub}.subscribed as {sub.subscribed}
from SUBSCRIPTION sub, PARTY
where PARTY.PARTY_ID = sub.PARTY_ID
and PARTY.USERNAME = ?
</sql-query>

When I execute this query, I get the following error:

net.sf.hibernate.QueryException: No column name found for property [partyID]....

Just for kicks, I changed my mapping to not use a composite key (I set partyID as the lone key) and it worked fine.

So, do I have to change the wording in my query when there is a composite key?

Thanks for your time!
chris


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 31, 2004 7:33 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Post it to JIRA please

_________________
Emmanuel


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.