I have a similar problem.
However, in my case, the generator try to use a sequence that does not exit: “hibernate_sequence”.
This is the offending code:
[Class(Table= "\"MyTable\"")]
public class MyClass
{
[Id(Column = "id", TypeType = typeof(int))]
[Generator(Class = "identity")]
public virtual int Id { get; set; }
// ....
}
When I try to save an instance of this class I get the following Exception:
NHibernate.Exceptions.GenericADOException: could not insert: [URLShortener.Model.ShortUrlModel][SQL: INSERT INTO "ShortUrls" (id, ... ) VALUES (nextval ('hibernate_sequence'), ... ) returning id]
---> Npgsql.PostgresException (0x80004005): 42P01: relation "hibernate_sequence" does not exist
Because I'm using NHibernate.Mapping.Attributes, I use the “Generator” attribute. However, I have no way of defining the name of the sequence used.
Paulo Santos