session.CreateQuery("delete from User u where u.UserName=
:toDelete").SetString("toDelete", "SKYWALKER").ExecuteUpdate();

On Wed, Feb 9, 2011 at 9:04 AM, Glenn <[email protected]> wrote:

> Hi.
>
> Does anyone have an idea on how to get from an Expression<Func<T,bool>> to
> an HQL query?
>
> For instance from
>   Expression<Func<User, bool>> exp = u => u.UserName == "SKYWALKER";
> to this HQL string:
>   "from User u where u.Username = 'SKYWALKER'";
>
> Just a pointer in the right direction would be appreciated.
>
> The goal is to use an expression, convert it into an HQL string and use it
> in the ISession.Delete().
>
>  --
> 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.
>



-- 
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