Dashboard > Castle Contrib > ... > ActiveRecordDataSource > Patch for use with ActiveRecord rc3
Patch for use with ActiveRecord rc3
Added by brian dunn, last edited by brian dunn on Feb 05, 2008  (view change)
Labels: 
(None)


changes to the NHibernate API mean that CriteriaCountQuery.cs won't compile against RC3. This looked Like a nightmare at first, until I found this
http://fisheye3.cenqua.com/browse/castleproject/trunk/ActiveRecord/Castle.ActiveRecord/Framework/Queries/CountQuery.cs

in revision 3205 Hammett kindly added criterias to the AR CountQuery. So to get ARDS to compile against RC3, just delete the CriteriaCountQuery.cs file, and change this line:

Index: ActiveRecordDataSourceView.cs
===================================================================
--- ActiveRecordDataSourceView.cs	(revision 443)
+++ ActiveRecordDataSourceView.cs	(working copy)
@@ -227,7 +227,7 @@
 
         protected int ExecuteCount(ActiveRecordDataSourceFindEventArgs args)
         {
-            IList result = ActiveRecordMediator.ExecuteQuery(new CriteraCountQuery(args.ModelType, args.Criteria.ToArray())) as IList;
+            IList result = ActiveRecordMediator.ExecuteQuery(new Castle.ActiveRecord.Queries.CountQuery( args.ModelType, args.Criteria.ToArray())) as IList;
 
             return Convert.ToInt32(result[0]);
         }
@@ -575,11 +575,18 @@

and update the project references to the RC3 Libs, and voiala! active record data source, and generic collections on your models. woot.

Site running on a free Atlassian Confluence Community License granted to Castle Project. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.4 Build:#809 Jun 12, 2007) - Bug/feature request - Contact Administrators