What I mean with "impossible" is that we can't check the stack-trace to run
a query.
We need a new HQL syntax as, for instance
using (select a.Id from Animal a) as MyTemp from Animals s where a.Id in
MyTemp

On Tue, Jul 13, 2010 at 4:42 PM, Vadim Chekan <[email protected]> wrote:

> I've never tried, but I can't see a reason why it would be impossible.
>
> Vadim.
>
> On Jul 13, 6:27 am, Mike <[email protected]> wrote:
> > I didn't realize this was possible. Are you saying that I can create
> > the temp table in my SP, and then reference it in an HQL or Criteria
> > query?
> >
> > On Jul 12, 9:54 pm, Vadim Chekan <[email protected]> wrote:
> >
> > > No, the funniest part is this:
> >
> > > > This worked great until  .. hit the limit of allowed parameters in
> SQL Server 2005
> >
> > > Mike, you need to predict how your code will work even before you
> > > wrote it. how much data is going to be retrieved, how many ID are
> > > going to be pushed back to sql, how much all this will take in RAM,
> > > etc.
> > > And always run sql profiler to see what your code is doing actually,
> > > otherwise it is source of horror stories :)
> >
> > > I would rather keep SP as SP. Leave data managing task to SQL Server,
> > > it is good with it. Without knowing details of your application, I
> > > would try to modify existing SP so that besides select, it creates a
> > > temporary table with selected IDs. Then you can select your related
> > > objects as "select * from MyRelatedObjects where ID in (select ID from
> > > #temp)".
> > > As a bonus you avoid ID roundtrip which will improve speed.
> >
> > > Vadim.
> >
> > > On Jul 12, 8:00 am, José F. Romaniello <[email protected]> wrote:
> >
> > > > This is the funny part:
> >
> > > > 2010/7/12 Mike <[email protected]>
> >
> > > > > At this point I do not have a business case to
> > > > > rewrite this Stored Procedure using NHibernate
> >
> > > > If this is not a "business case to rewrite the sp with NH", then you
> will
> > > > have to change your SP.....
> > > > forget about selecting with a list of ids.
>
> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<nhusers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>
>


-- 
Fabio Maulo

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to