I have decided to get the HQL working. Any ideas why this:

IQuery query = NHibernateHelper.GetCurrentSession()
                .CreateQuery("from Square as s where s not in (select
s from Square as s left join s.Items as i where i.ItemId = :ItemId )
order by :order")
            .SetParameter("ItemId", ItemId)
            .SetParameter("order", "SquareId asc")
            .SetFirstResult((int)start_index)
            .SetMaxResults((int)number_of_requested_rows);

            return query.List<Square>();

does not work (tried .SetString("order", "SquareId asc") as well) but
this does:

IQuery query = NHibernateHelper.GetCurrentSession()
                .CreateQuery("from Square as s where s not in (select
s from Square as s left join s.Items as i where i.ItemId = :ItemId )
order by SquareId asc")
            .SetParameter("ItemId", ItemId)
            .SetFirstResult((int)start_index)
            .SetMaxResults((int)number_of_requested_rows);

Thanks.

C

On Jun 23, 9:52 am, Tuna Toksoz <[email protected]> wrote:
> You can do this with Criteria+DetachedCriteria...
>
> Tuna Toksöz
> Eternal sunshine of the open source mind.
>
> http://devlicio.us/blogs/tuna_toksozhttp://tunatoksoz.comhttp://twitter.com/tehlike
>
>
>
> On Tue, Jun 23, 2009 at 11:50 AM, csetzkorn <[email protected]> wrote:
>
> > Is this a good solution? Would prefer Criteria API solution though.- Hide 
> > quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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