That single query returns all the data I need, but the problem is that I can not capture that data into my DAL objects. I have currently fixed the problem by defining the constructor that NHibernate is looking for.
On Dec 2, 8:42 am, "Gabriel Schenker" <[EMAIL PROTECTED]> wrote: > why don't you use MultiQuery? > > On Mon, Dec 1, 2008 at 10:26 AM, Huseyin Tufekcilerli <[EMAIL > PROTECTED]>wrote: > > > > > I have an HQL like this which works fine: > > > select new DeviceLite(d.Id, d.Code, d.Name, c.Name) from Device d > > > Device is the heavy weight object and DeviceLite is the light-weight > > one which name suggests. I want to do sth like this (not exactly by > > conceptually similar) > > > select new DeviceLite(d.Id, d.Code, d.Name, c.Name), d.PurchaseDate > > from Device d > > > What I expect from this query is to return a list of object[2] types > > whose first element is a DeviceLite object and second element is a > > DateTime. But this query throws a NHibernate.QueryException which > > wraps a NHibernate.InstantiationException. The reason as far as I can > > see is that it is trying to find a constructor for (System.Guid, > > System.String, System.String, System.String, System.DateTime) and I > > don't have a DeviceLite ctor with a DateTime parameter at the end. > > > Is there a special syntax for these kind of selects in HQL or this is > > not supported? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
