-->
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: The persistence entity object return cannot be set
PostPosted: Fri Feb 17, 2006 6:48 am 
Beginner
Beginner

Joined: Wed Jan 25, 2006 7:32 am
Posts: 34
Hi,

I have defined 3 tables as below:

Listing
==================
ID Description
==================
1 My book is good
--------------------------------
2 My car is for sale
--------------------------------
3 My pda is for sale
==================


Alert
==================
ID Keywords
--------------------------------
1 book
--------------------------------
2 book
--------------------------------
3 sale
--------------------------------

These 2 tables has no relationship at all. What I need to do is to find a list listing which match description with keywords from Alert table.

Therefor the query is

select l, from listing l, alert a where l.description like concat('%',a.keywords,'%')

This query is valid when I run it at the mysql command line.

but when I applied it in hibernate, it fails.

at Listing.hbm.xml and Alert.hbm.xml, all the parameters are defined.
Also, the persistence entity class for Listing and Alert are defined with it's setter and getter method as the mapping to the tables.
No relationship between these 2 tables are defined in the hbm.xml files and persistence entity class files.

I wonder is the problem because of the no relaitionship defined? If this is true, how can I the relaitionship be defined at the hbm.xml files and class files?

please guide.thank you


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 20, 2006 10:59 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
You don't need any relationship defined for that sort of query. What is the error you're getting? Full text would be best.


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.