Oh a little mistake

                DetachedCriteria detac=DetachedCriteria.For<Test2>("TAR")
                     .Add(Restrictions.EqProperty("TAR.TestId","T.Id"))

 
.Add(Restrictions.EqProperty("TAR.datetime",Projections.SqlProjection("getdate()-1",

                new []{"Ddate"},

                new []{NHibernateUtil.GuessType(typeof(DateTime))})))
*                     .SetProjection(Projections.Count());*

                var crit=session.CreateCriteria<Test>("T");
                crit.AddOrder(Order.Desc(Projections.SubQuery(detac)));




Tuna Toksöz
Eternal sunshine of the open source mind.

http://devlicio.us/blogs/tuna_toksoz
http://tunatoksoz.com
http://twitter.com/tehlike




On Sun, Jun 21, 2009 at 3:24 PM, Tuna Toksoz <[email protected]> wrote:

>                 DetachedCriteria detac=DetachedCriteria.For<Test2>("TAR");
>                 detac.Add(Restrictions.EqProperty("TAR.TestId","T.Id"))
>
>  
> .Add(Restrictions.EqProperty("TAR.datetime",Projections.SqlProjection("getdate()-1",
>
>                 new []{"Ddate"},
>
>                 new []{NHibernateUtil.GuessType(typeof(DateTime))})));
>
>                 var crit=session.CreateCriteria<Test>("T");
>                 crit.AddOrder(Order.Desc(Projections.SubQuery(detac)));
>

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