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
|