-
Recently I was forced to do full time development on my MacBook because I killed my Windows Laptop (btw, turns out it is a bad idea to spill milk on the keyboard of a laptop… who knew). When doing this I was running Windows7 under VM via Fusion. Everything was working great……until...
-
I've been asked a few times if it's possible to use NHibernate Validator to create a custom validator at the class level, in addition to custom property validators. The short answer is yes. (But it would make a rather uninteresting post if I stopped here.) The documentation at http://nhforge...
-
Just as a reminder, even though you might have seen it before on twitter or nhforge or Ayende’s blog As of today, we released the first version of NHibernate.Linq. It is currently based on Criteria API, and can handle many situations that it can handle. NHibernate.Linq was the first project that...
-
Last week I spoke at CRineta (Cedar Rapids Ineta) on NHibernate . It was an introductory topic on NHibernate and as such I talk a bit about persistence and what it is. I find that it is worth defining persistence because, while it exists in most/all applications, many of us view persistence so very differently...
-
This is a recent question raised in NHibernate Users Group . The user wanted to realize the following query with Criteria api. var result = db.Person.Where(x => x.Pets.Count > 0 && x.Alive).OrderBy(x => x.Name); This is not a simple query, but it has a solution DetachedCriteria crit...
-
We’ve been getting many requests on having fluent configuration for NHibernate Integration Facility, and as I like programmatic configuration more than XML configuration (did I mention that I hate XML?), I decided to work on it. After 2-3 hours, I got the below more or less working container.Register...
-
Recently (ok, today) I needed to drop down into ADO to call a procedure in our code. I was not too happy with it, but either my lack of knowledge or lack of will to figure it out mandated it. What I needed to do was create a build-insert process and using NHibernate was not the right solution...
-
Today I was needing to create a query which looked a bit like this: SELECT max(this_.SEQUENCE) as y0_, this_.ADMISSION_ID as y1_ FROM PT_Status this_ GROUP BY this_.ADMISSION_ID As you can see, I was trying to do a group by one column and a Max() on another column (legacy DB’s gotta love them)...
-
Disclaimer: This will be another post on events and extensibility points of a framework, but I can’t resist! Recently, on one of my pet projects, I wanted to use db4o, and the problem was I should have explicit POIDs on my objects. Db4o has two mechanisms for Id stuff, one is GetId function, which...
-
Pop quiz, what is the difference between Expression.Lt (.Gt, .Eq, etc) and Expression.LtProperty (.GtProperty, .EqProperty, etc)? If you know the answer off the top of your head you win the prize… What is the prize you may ask? NOTHING…. Anyway, I needed to create a criteria query where I wanted to filter...
-
When developing your data access layer with NHibernate you are bound to run into some pretty nasty exceptions. Many times the exceptions may be nasty, but at least they explain the problem in enough detail to allow you to solve the problem. But what do we do when the exceptions do not convey enough information...
-
As if my life wasn't boring enough trying to get S#arp Architecture 1.0 out the door...
Posted to
Billy McCafferty
by
Billy McCafferty
on
05-03-2009
Filed under:
Filed under: Architecture, C#, .NET, Software Development, SQL Server, Algorithms, Refactoring, NHibernate, Project Management, Test-Driven Development, Agile Development, MVC.NET, S#arp Architecture, DDD
-
As I pointed in a prior post ( here ) when trying to learn to harness the power of NHibernate sometimes the ‘simple’ can be a bit daunting at first. For instance how do you create a query with NHibernate that looks a little like the information below? Where .... AND ( ( a = x AND b = true ) or...
-
As you are learning how to use NHibernate many of the ‘common’ things you are used to doing with standard SQL crop up. One of them for me was to have the ability to perform a Count() query. If I were using straight SQL my query may look something like this: SELECT COUNT( FieldNameHere ) FROM...
-
Of the many things that NHibernate is, simple and ‘straight forward’ it is not (at times). Recently I needed to do a SubQuery, so of course the first thing I did was try to Google it. I was able to find quite a few examples on how to create and execute a subquery, but none of them had ALL...