-->
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: [Newbie] Selecting by column in a many-to-one relationship
PostPosted: Mon Apr 10, 2006 5:31 am 
Newbie

Joined: Mon Apr 10, 2006 5:16 am
Posts: 1
Hibernate version: 3
Name and version of the database you are using: hsqldb 1.8.0.1

I'm using hibernate through spring, and I have a many-to-one mapping between two objects. So there's

KpiSummary which has:

Code:
<many-to-one name="category" column="kpi_category_id" not-null="true" lazy="false/>


Category has:

Code:
<property name="description" column="description" type="string"  not-null="true"/>


What I want to be able to do is select KpiSummary instances for a particular category description (or serial at a push). Like this:

Code:
return this.getHibernateTemplate().find("from KpiSummary where category.description = ?", new Object[]{pCategoryName});


but this fails with an org.hibernate.QueryException: could not resolve property: description of: com.company.kpi.dom.KpiSummary.

Can someone point me towards some documentation on how to do this please, I haven't managed to find any.

Thanks,

Tim.


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.