Or better yet, use one of the Result Transformers and you'll get a nice list
of DTOs

On Wed, Feb 11, 2009 at 11:46 PM, Ken Egozi <[email protected]> wrote:

> The exception is quite informative.You need to specify the return types
> for the query, as you are not returning any NH object so NH does not now how
> to read the IDataReader.
>
> use the AddScalar() method on IQuery to specify the returned columns
>
>
> On Wed, Feb 11, 2009 at 11:32 PM, Michał Staszewski 
> <[email protected]>wrote:
>
>>
>> Tyler Burd wrote:
>> > I ran into this issue not long ago.  The generic type parameter on
>> SimpleQuery MUST be an Active Record persistent class.  You can't use
>> SimpleQuery to get DTOs or integer results.
>> >
>> > If you go to a lower level and use the good ol' session.CreateQuery or
>> session.CreateSqlQuery things should work just fine.
>> >
>> > Does that help?
>> >
>> > -tyler
>> >
>> >
>> Thx for answer.
>>
>> I also tried session.createSQLQuery() with following code:
>> Code:
>>
>> ISQLQuery sqlQuery = this.m_database.GetSessionFactoryHolder
>> ().CreateSession (typeof (DrawingAR)).CreateSQLQuery (
>>                        MAX_BOUNDING_BOX_QUERY);
>>
>>                IList list = sqlQuery.List ();
>>                long[] result = (long[]) list[0];
>>
>>
>> but then i get
>>
>> Quote:
>>
>> Return types of SQL query were not specified [SELECT min(xmin(box2d
>> (shape))) as a, min(ymin(box2d(shape))) as b, max(xmax(box2d(shape)))
>> as c, max(ymax(box2d(shape))) as d FROM drawings;]
>>
>>
>>
>> And acctualy don't now where to specify them. Can you help?
>> Mike
>>
>> >>
>>
>
>
> --
> Ken Egozi.
> http://www.kenegozi.com/blog
> http://www.delver.com
> http://www.musicglue.com
> http://www.castleproject.org
> http://www.gotfriends.co.il
>



-- 
Ken Egozi.
http://www.kenegozi.com/blog
http://www.delver.com
http://www.musicglue.com
http://www.castleproject.org
http://www.gotfriends.co.il

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" 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/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to