-->
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: Query Problem with inheritence
PostPosted: Wed Apr 14, 2004 1:50 am 
Beginner
Beginner

Joined: Thu Feb 26, 2004 6:59 am
Posts: 47
Location: Gurgaon, India
Hello,

I am facing a problem while firing find query for an inheritence relation. Scenerio is:

class Catalog
catalog_id, ownerName, Name, description
^
class Query
sid, parent_id

I want to search query object based on passed filter criteria, some of which are on catalog attributes and some are on query.

Code is :

Query q = session.createQuery("select catalog from com.aceva.rms.catalog.Query catalog where catalog.ownerName='Mohit' and catalog.parent_Id=2");

on executing this query, generated sql is required one, and giving result in sql edition. sql generated is:

select query0_.sid as catalog_id, query0_.parent_id as parent_id4_, query0_.private as private4_, query0_.definition as definition4_, query0__1_.name as name0_, query0__1_.owner_name as owner_name0_, query0__1_.description as descript4_0_,
query0__1_.entry_type as entry_type0_, query0__1_.update_date as update_d6_0_, query0__1_.locale as locale0_ from Query query0_, CatalogEntry query0__1_ where query0_.sid=query0__1_.catalog_id and ((query0__1_.owner_name='Mohit' ) and(query0_.parent_id=2 ))

But problem is that, we are not getting record with hibernate api. ie query.list returning empty list.

Please help, what can be wrong at our part.

Thanks,

_________________
Mohit Gupta
Software Engineer
Gurgaon, India


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 15, 2004 2:09 am 
Beginner
Beginner

Joined: Thu Feb 26, 2004 6:59 am
Posts: 47
Location: Gurgaon, India
I got the desired result from the query, but without knowing the reason that why it was not working previously.

Still it is resolved now.

Thanks,


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.