Hi Nadav,

I’m not sure that is possible using QueryOver.  At least, if it ‘is’ possible, 
I doubt the syntax would be very nice (which means there would be no advantage 
to choosing it).  I suspect QueryOver is not the best tool for the job in this 
example.

I think your best bet is to consider the HQL example.  Or, if your SQL is 
already working, perhaps leave it the way it is?  Another alternative might be 
to try using custom extensions on the LINQ provider.  You’ll know best how much 
time you have to spend on it.

Regards,
    Richard


From: Fabio Maulo 
Sent: Tuesday, December 21, 2010 1:08 PM
To: [email protected] 
Subject: Re: [nhusers] Re: DateTime fields aggregation using QueryOver
after solve you "magic-string" problem you have to solve "magic-numbers"


On Mon, Dec 20, 2010 at 4:01 PM, Nadav Ben-Gal <[email protected]> wrote:

  hey,
  as i said, HQL/Criteria doesn't help me... its the same as pure SQL in
  that case...
  it doesn't help me remove the magic strings aka - ca.ToHour/
  ca.FromHour/ca.StudyCard.id etc) that's why i asked for a QueryOver,
  if it is even possible...

  Thanks,
  Nadav Ben-Gal



  On Dec 19, 11:59 pm, Fabio Maulo <[email protected]> wrote:
  > uow.Session.CreateQuery("select SUM(((hour(ca.ToHour) -
  > hour(ca.FromHour)) * 10000000 * 60 * 60 ) + ((Minute(ca.ToHour) -
  > minute(ca.FromHour)) * 10000000 * 60)) from CalendarAppointment ca
  > where ca.StudyCard.id = :studyCard").SetInt64("studyCard",
  > appointment.StudyCard.Id).UniqueResult();
  >
  > or something like that

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