-->
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: Filter with joins.
PostPosted: Mon Feb 04, 2008 7:30 pm 
Newbie

Joined: Thu Aug 10, 2006 10:08 pm
Posts: 12
Hi I am trying to get Filters to work with a join clause and a from,

however it seams that when i add these to the HQL it seems to start ignoring the collection that i have use for the filter.

following tis the code i use to call the filter.

Code:
                allCancelsNoRun = (IList) Persistor.getSession().Filter(this.TransactionSet,
                                                                        @"SELECT COUNT(this),sum(this.Amount)
                                                                        from Transaction
                                                                        Join t.Rejects as rejects
                                                                        WHERE this.id  not in(
                                                                           select
                                                                              r.EFTTransaction.id
                                                                           from
                                                                              EFTReject r
                                                                           Where r.errorCode = 0
                                                                       ) and (rejects.errorCode <> ? AND rejects.errorCode <> 5 AND rejects.errorCode <> 51)"
                                                                        , 0, NHibernateUtil.Int32);


the above query works but it dosnt restrict the set to only those initially in TransactionSet.


I figure there is to ways that i should do this.

1. try and join against this, but i have had no luck getting this to work something like

Code:
from this t join t.Rejects as rejects


2. try and add into the where clause.

Code:
where t in this 


also no luck with this.

looking forward to any insite you can give.

thanks

Jsutin


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.