Hudson is referring to the Id(...).GeneratedBy bit. Since you are using a Guid primary key, you need to call one of the following: Id(...).GeneratedBy.Guid(); // NH will call Guid.NewGuid() Id(...).GeneratedBy.GuidComb(); // Uses the Guid Comb algorithm to improve performance and indexing capabilities Id(...).GeneratedBy.Assigned(); // NH expects *you* to assign an ID before calling .Save()
As for the " I get an "Identity type must be integral (int, long, uint, ulong)" error." that means that somewhere in your code you are calling Id(...).GeneratedBy.Identity(). Identity columns are integer (usually auto-incrementing) columns. As such, it makes no sense to tell NH that an integer column on the database maps to a Guid value in code. FNH helpfully throws an exception telling you that it must be integral(int, long, uint, ulong). Hope that helps. On Mon, Jun 1, 2009 at 8:14 AM, Brian Kendig <br...@enchanter.net> wrote: > > On May 29, 6:17 pm, Hudson Akridge <hudson.akri...@gmail.com> wrote: > > I believe your generator class should be Assigned. > > Which generator class? I don't follow... > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to this group, send email to fluent-nhibernate@googlegroups.com To unsubscribe from this group, send email to fluent-nhibernate+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en -~----------~----~----~----~------~----~------~--~---