-
Easy and Instant deployments and instant scale for .NET? Awhile back a few of us were looking at Ruby Gems as the answer to package management for .NET . The gems platform supported the concept of DLLs as packages although some changes would have needed to happen to have long term use for the entire...
Posted to
Rob Reynolds - The Fervent Coder
by
Rob Reynolds
on
02-16-2011
Filed under:
Filed under: NHibernate, Fluent NHibernate, RoundhousE, HowTo, UppercuT, Development, Git, Tools, .NET, Agile, Gems, Challenge
-
Have you ever noticed that out of the box NHibernate’s DateTime type will truncate/ignore your milliseconds for DateTime fields? If you do not believe me check out this post . If you think about why it does this it will become clear, NHibernate runs against MANY databases and each one of them stores...
-
When you are setting up your NHibernate mappings you must pay close attention to the way you setup your relationships between your entities. Recently I started profiling some of our statements and was shocked to see how some of them had a metric-crap ton of joins when they only needed one or two...
-
Today as I was creating a new NHibernate Criteria statement everything was working fine UNTIL I added the where clause. At this point I started to get the following exception (which was seen via NHibernate Profier ). WARN: System.Data.SqlClient.SqlException: The multi-part identifier "doc2_...
-
I’m a huge fan of NHibernate . It has excellent documentation and just makes the whole job of getting things into and out of the database much more enjoyable. There is a whole series of posts on NHibernate from one of the committers, Ayende . When Fluent NHibernate (FNH) came out, it was...
-
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...
-
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)...
-
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 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...
-
If you have ever used NHibernate I am sure you have encounted the error ‘Invalid Index ‘N’ for this SqlParameterCollection with Count=N’ (where N is any number) exception when trying to create your mappings. If you are completely new to NHibernate, as I am I am sure this one has you scratching your head...
-
In my last post I talked about how I needed to eager load my data in order to send it back across the wire. Normally I am not a big fan of creating tests to ensure that I can hit the database, but in this case the act of eager loading needs to be verified and constant. When I set out to create...