-->
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: many-to-one
PostPosted: Fri Jan 02, 2004 2:55 pm 
Newbie

Joined: Fri Jan 02, 2004 1:32 pm
Posts: 2
<many-to-one name="test" column="test_ID" class="test.TestData" not-null="true" unique="true">
<meta attribute="finder">findByTestData</meta>
</many-to-one>

I want to get generate a finder method (findByTestData) using this many-to-one relation. Could you please help me.

Thanks,
sg.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 03, 2004 7:40 pm 
Expert
Expert

Joined: Tue Sep 16, 2003 4:06 pm
Posts: 318
Location: St. Petersburg, Russia
It is not really clear what do you want. If you need to find all objects which are linked to TestDatas with specific properties? If yes, try something like

select distinct myc
from MyClass as myc
join myc.test as data
where data.property=?

Where "MyClass" is the name of the class which have <many-to-one> mapping and "property" is the name of the TestData property you are looking for.

Btw, documentation shows alot of examples. See "9.3. Associations and joins"


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.