Friday, March 27, 2009

Google Voice

I'm setup with Google Voice now. It's a very nice service. I think it's going to radically transform how the phone works. As a simple example, try giving me a call with the enclosed Google Voice gadget I've just put in the side panel. It will call your phone, then connect back to me via their servers. A nice way to provide connectivity without having to advertise your number. I can't wait to see the pricing for this service. It obsoletes normal voicemail (since it provides a decent transcribed version of the voice mail). The management of voicemail is the same as email is in gmail.

Wednesday, January 07, 2009

NHibernate.MappingException: Unknown entity class

I spent an hour finding and fixing a problem that should have been much faster last night. This post is to make sure I don't forget what I learned :-) I’m experimenting with NHibernate, and specifically the FluentNHibernate functionality. I was trying to get a test running, and I kept getting the error: “NHibernate.MappingException: Unknown entity class BLAH” (where BLAH was the persistable class I was building) during the mapping setup of the test.

I dug all over the place (assuming I had a typo in a namespace or some other stupid thing like that), and couldn’t find the problem until I ran Reflector on the assembly that held the mappings. Only then did I notice that the mapping class was grayed out (in other words, I’d failed to make the map public -- in fact when I created the class, I failed to set accessibility at all so it was set to the default accessibility of internal). Once I set access to the class to public, the test ran as expected, and I was able to finish setting things up.

  public class BLAHMap : ClassMap<BLAH> {

    public BLAH() {...}

  }

I’m sure this is in the docs somewhere, but the bottom line is: don’t forget to make mapping classes public. The other takeaway from this is that it’s good to have multiple ways of looking at something – reflector showed the problem because it had a different way of displaying information that wasn’t visible just by looking at the editor.