NHibernate Query Generator - Collection querying
In the repository (Exists / NotExists):
1: [Test]
2: public void CanQueryOverCollections()
3: {
4: User one = User.FindOne(Where.User.Blogs.Exists(
5: Where.Blog.Name == "Ayende @ Blog"
6: ));
7: Assert.IsNotNull(one);
8: }
1: SELECT this_.Id as Id4_0_, this_.Name as Name4_0_, this_.Email as Email4_0_
2: FROM Users this_ WHERE exists (SELECT this_0_.Id as y0_ FROM Blogs
3: this_0_ WHERE this_0_.Name = @p0)
Fluent interfaces? Take that.
Comments
I toyed around with fluent interfaces recently but found that it made the methods too confusing to follow like Martin states in his bliki, and take a little more time to plan out.
Do you see any real benefit when using fluent interfaces with a very small team? 1-2 people?
Look at the query above and tell me if it isn't very clear what is going on around there?
I certainly think so
I don't think the team size has very much to do with it. These tools help you read the code when making changes after 4 months of working on a different project :)
It`s cool!! But where can I get simple quickstart and some examples for NQG ? Can you help me with this, please?
I will try to post something about it soon.
Looks very useful indeed.
Is the "Where" class available, and if so in what assembly? I tried locating it in my current MonoRail/ActiveRecord.NET/NHibernate set of assemblies, but couldn't find it.
Sander,
It is a class that is generated by NHQG
I'm sorry to post this here since it might be a bit off topic, but I can't seem to get NHQG working as a VS custom tool. I have put NHibernateQueryGenerator as the Custom Tool in my hbm's properties and it creates a foo.hbm.cs file. However, the file doesn't seem to ever get updated. I can't figure out what I'm missing though. I'm using NHQG 1.9.
Also, is there a way to get it to recurse through directories if running cmd line? I've tried */.hbm.xml, but get an error.
Nick, because of the issues in getting the custom tool to work, I am not keeping track of it anymore. It certainly should work, if you put the right registry entries, but the complexity and constant updating just didn't make it worthwhile for me.
About the second, there isn't a way to do it right now, feel free to send a patch.
Thanks. It was the registry issue.
Comment preview