Re: Aw: ActiveRecord Inner Query

2011-06-08 Thread Erdem
Hi Markus, You are right, the query on my previous example does not make sense. But I had just tried to explain the situation that I'm having trouble with. I hope the query below has more meaning then the previous one. Just trying to group actions by user_id, then join with users and applying

Aw: Re: Aw: ActiveRecord Inner Query

2011-06-08 Thread Markus Zywitza
You don't understand correctly: AR/NH works upon objects not tables. Without any classes and mappings no one can show you any Criteria or HQL. HQL is quite powerful, see here for example: http://nhforge.org/doc/nh/en/index.html#queryhql-examples Alternatively, if these queries are not part of

Re: Aw: Re: Aw: ActiveRecord Inner Query

2011-06-08 Thread Erdem
Hi Markus, While I'm checking the HQL documentation that you sent, I've discovered the AddEntity method of CreateSQLQuery. I think this is exactly the thing that I'm looking for. Now I can run any SQL query that I want and map it to my object. Of course, this is not the way that AR works.

ActiveRecord Inner Query

2011-06-08 Thread Markus Zywitza
Then the best bet is creating views from the queries and map those views to readonly viewmodel classes using AR. You can then use all your Oracle server gives you for querying and use AR to load and display the results. -Markus -- You received this message because you are subscribed to the

Re: ActiveRecord Inner Query

2011-06-08 Thread Erdem
Yes you are absolutely right. Is there any special way of creating readonly classes or is that just adding [Insert=false] attribute to properties? Thanks a lot for your helps. Erdem -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To

RE: ActiveRecord Inner Query

2011-06-08 Thread Nicholas Kilian
Mutable=false From: castle-project-users@googlegroups.com [mailto:castle-project-users@googlegroups.com] On Behalf Of Erdem Sent: 08 June 2011 03:08 PM To: castle-project-users@googlegroups.com Subject: Re: ActiveRecord Inner Query Yes you are absolutely right. Is there any special way

Aw: ActiveRecord Inner Query

2011-06-07 Thread Markus Zywitza
This query is basically select * from tbl_user, in HQL from Users. Your query creates a cross-join about the table, selecting all rows with matching IDs. If ID is a PK, this is simply a select * from tbl_user, because the only matching rows in this cross join are those that match a row to

ActiveRecord Inner Query

2011-06-07 Thread Erdem
Hi all, We are not able to write a query as below in activerecord by using neither DetachedCriteria nor HQL. This is just a sample query, we just like to see the resultant sql query like this: *SELECT ** * FROM (SELECT ** * FROM TBL_USER) U1,* * (SELECT ** * FROM