What I'd like to do is pass a parameter to an object constructor like
this...

select new Foo(:dateParam)

I can't seem to get that to work, and my searches for help are coming
up dry. How can I do this?

Specifically, I have a named query called
CreateDailyRecordsForDateLocation that's using an object constructor.
It looks something like this...

select new DailyRecord(p, l)
from Enrollment e
inner join e.Person p
inner join e.Location l
where e.Location.LocationId = :locationId
   and :dateOfRecord >= e.EnrollmentDate
   and :dateOfRecord < e.DropDate

(A person enrolls at a location on a certain date, and each day we
create a record for each person enrolled at each location.)

This works fine, but I really want my instance of DailyRecord to be
initialized with the date I pass in. But as I've said, saying "select
new DailyRecord(p, l, :dateOfRecord)" doesn't seem to be supported.

Any help would be greatly appreciated!


--Stuart
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to nhusers@googlegroups.com
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