alkampfer on March 9th, 2010

I have this piece of domain model.

The LinkResult class has a property called Link that point to a AnalyzedLink class that in turn has a collection of AnalyzedLinkExtClass called ExtData. All the relation are unidirectional, this means that there is nothing that bring me from AnalyzedLink to a linkResult and nothing that bring me [...]



kick it on DotNetKicks.com

Continue reading about Power of HQL – Condition on a collection

alkampfer on February 26th, 2010

Working with open source software is fun, but sometimes can be difficult. Take as example castle and Nhibernate, since castle references nh with the NHIntegration facility, and at the same time NH references castle for Dynamic Proxy.
A good way to survive this chaos, is working with the trunk, as I usually do, but compiling everything [...]



kick it on DotNetKicks.com

Continue reading about Work with castle and NHibernate trunk

alkampfer on October 13th, 2009

When you use NHibernate and asp.net one of the most interesting stuff is looking at sql generated for each page call. While NHProf is the best tool to accomplish this task, it is interesting to trace issued sql queries using asp.net trace engine.
To accomplish this task is really straightforward thanks to log4net, first of all [...]



kick it on DotNetKicks.com

Continue reading about Show NHibernate query in the trace of asp.net pages

alkampfer on October 13th, 2009

I have a project where I need to access tables with millions of rows, the project was born without nhibernate so the database was not designed with ORM in mind. I decided to improve performances with an Indexed view that materialized a join between five tables, wrapped with another view that does a left outer [...]



kick it on DotNetKicks.com

Continue reading about NHibernate ICriteria and filters

alkampfer on September 4th, 2009

NHibernate HQL language is really powerful, and work in many scenario. Suppose you have those two classes.

Action is an object capable of executing something, while ActionLog stores the result of the execution of an action. There is no direct relation between the two, so in ActionLog we have not a reference to Action, but [...]



kick it on DotNetKicks.com

Continue reading about Theta join in HQL – join with unrelated entities