views:

37

answers:

1

Hi all,

We use a lot of view model builders which pass HQL strings to the ActiveRecordMediator.Execute method to populate search objects for our views.

Doing refactoring occassionally breaks these 'magic' hql strings (without us knowing)

I was wondering if anyone has tried using nhibernate named queries to validate HQL in Castle Active Record?

Is there another way rather than writing integration tests (we use LINQ to Nhibernate for basic searchs but its not quite there yet for our complex queries)

Anyone have suggestions how to validate HQL against your domain?

+3  A: 

ActiveRecord supports named queries through the HqlNamedQuery attribute, see this article. By defining queries this way you get NHibernate's named query validation.

Mauricio Scheffer