title: NHibernate with string primary key and relationships
body: <p>I've have just been stumped with this problem for an hour and I annoyingly found the problem eventually.</p>
  
  <p><strong>THE CIRCUMSTANCES</strong></p>
  
  <p>I have a table which users a string as a primary key, this table has various many to one and many to many relationships all off this primary key.</p>
  
  <p>When searching for multiple items from the table all relationships were brought back. However whenever I tried to get the object by the primary key (string) it was not bringing back any relationships, they were always set to 0. </p>
  
  <p><strong>THE PARTIAL SOLUTION</strong></p>
  
  <p>So I looked into my logs to see what the SQL was doing and that was returning the correct results. So I tried various things in all sorts of random ways and eventually worked out it was. The case of the string being passed into the get method was not EXACTLY the same case as it was in the database, so when it tried to match up the relationship items with the main entity it was finding nothing <strong>(Or at least NHIbernate wasn't because as I stated above the SQL was actually returning the correct results)</strong></p>
  
  <p><strong>THE REAL SOLUTION</strong></p>
  
  <p>Has anyone else come across this? If so how do you tell NHibernate to ignore case when matching SQL results to the entity? It is silly because it worked perfectly well before now all of a sudden it has started to pay attention to the case of the string.</p>