[This article was originally published on my personal blog here . I hereby grant myself permission to re-publish it on NHForge.org.] [Code for this article is available on GitHub here .] Nothing gets an OO zealot hot under the collar the way the term polymorphism does. You probably have three questions...
In the spirit of “ Release early. Release often. And listen to your customers ” ( cit. ), even if not so early in term of time since the preview , I decided to release a first drop of the “HQL Intellisense thing” I’m working on. The current version is just able to load an...
[ My blog ] I’m proud to announce NH2.1.0 is passing all tests (same of H3.3.1) for bulk actions using HQL. Some HQL examples: insert into Animal (description, bodyWeight, mother) select description, bodyWeight, mother from Human insert into Pickup (id, Vin, Owner) select id, Vin, Owner from Car...
[ from my blog ] Mapping: < class name = " SimpleClass " table = " TSIMPLE " > < id type = " int " > < generator class = " native " /> </ id > < property name = " Description " /> </ class > Class: public class SimpleClass...
One of the more interesting ability of NHibernate is to selectively filter records based on some global filters. This allow us to very easily create global where clauses that we can flip on and off at the touch of a switch. Let us take a look at see what I mean. We define the filter effectiveDate: <...
One of the more common mistakes that I see people doing with NHibernate is related to how they are loading entities by the primary key. This is because there are important differences between the three options. The most common mistake that I see is using a query to load by id. in particular when using...
Steve from iMeta has been doing a lot of work on the HQL AST Parser. For a long time, that has been a really troublesome pain point for us, since this is a prerequisite for a lot of other features. It is also one of two parts of NHibernate that really need significant refactoring because the way they...
A few days ago Oren Eini and Davy Brion were working in a new feature for NH 2.1 (no a release yet) called Future, in the ICriteria API. You can see and explanation of the job here . Now I’ve committed a complement to enable that use into the IQuery API, for those who prefer to use HQL. What is...