Hi Visar

The target type is not the type being returned. AR allows to use
multiple databases. The database for each type is chosen through an
abstract baseclass. Without providing the target type, AR cannot know
which session or session factory it has to use to run the query. The
return of SimpleQuery.Execute() is AFAIR always object[][],
independent of target type.

If you don't use multiple databases and have no clear candidate for
target type, you can simply use ActiveRecordBase, which is the
abstract base class for types using the default database, even for
those types that don't have a base class other than object.

-Markus

2010/7/12 Visar Uruqi <visar.ur...@gmail.com>:
> Why do I have to provide always the target type, when I build a query
> be it custom query, SimpleQuery, HqlBasedQuery always I have to write
>
> new SimpleQuery(typeof(SomeObject) ,...
> new HqlBasedQuery(typeof(SomeObject) ,...
>
> Can't I just write HQL and parse, or Transform the result to some
> CustomObject?
>
>
>
> On Jul 12, 1:26 pm, Visar Uruqi <visar.ur...@gmail.com> wrote:
>> Hello
>>
>> I'am new to ActiveRecord but not to Nhibernate, I've done two projects
>> with Nhibernate.
>> Since I saw a presentation from ayende for Castle ActiveRecord, I  was
>> blown away and want to learn all what ActiveRecord has to offer, I've
>> started something with ActiveRecord but I'm having a problem when I
>> want to return multiple entites, I looked at the documentation
>>
>> http://www.castleproject.org/activerecord/documentation/v1rc1/usersgu...
>>
>> but still can not figure out how to return multiple entities and
>> tranform them via AliasToBean<ReportingObject> ?
>> what is the best way to do query's with joins where the result is
>> mixed with fields from many entities?
>> How to transform them to an object that is not (say) part of the
>> DomainModel (not persisted) but just for reporting
>> purposes?
>>
>> IS THERE A BOOK FOR CASTLE ACTIVE RECORD?
>> OR A USER MANUAL?
>> Where can I find resources for Castle Active Record?
>>
>> Thank you for your time
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Castle Project Users" group.
> To post to this group, send email to castle-project-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> castle-project-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/castle-project-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to castle-project-us...@googlegroups.com.
To unsubscribe from this group, send email to 
castle-project-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.

Reply via email to