-->
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: how to implenet my query (with subquery)in createCriteria
PostPosted: Mon Dec 15, 2008 6:09 am 
Newbie

Joined: Wed Dec 03, 2008 8:05 am
Posts: 11
Hi ,
I have Query as follows ,

select * from AUDIT_LOG where DOC_ID in (select doc_id

from INFORMATION where DOC_ID =261)

I would like to implement in the createcriteria.

Can any one suggest me how to implement?

Actually I am facing problem of association .

I have 1 more tabel in addation to the above.

this is the main table called Master_DOC and DOC_ID is the primary key .this column refered by both the tables ..

Also above tables have assoction with the Master_DOC .

At the time of fetching data both the table should check whether entry for Doc_id present in the MST_DOC.

so whatever DOC_ID's exists I should get the details from the AUDIT_LOG.

What problem I am facing is that classCast exception or wrong records are populated..


since INFORMATION table has SERIAL primary key. and I have made assoction with this table in the Audit_LOG and refering to DOC_Id but

hiberte is always firing query as Audit_LOG.doc_ID = Information.SERIAL.

Please help me ................................

Thanks in advance.


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.