views:

51

answers:

1

Hai, I`m Newbie in Fluent Nhibernate.. I have postgreSql Database and what i want is generated id with auto increment.. i have no see feature auto increment in Postgres and i was understand that for use auto increment in postgreSql i must create sequence..

there is other way beside sequence?

if create sequence is the only way, can You tell me how I mapping it? I was tried use this and not success :

mapping.Id(x => x.Id, "id").GeneratedBy.Sequence("hibernate-sequence");

i was created hibernate-sequence before

Regards

+1  A: 

Just use the datatype SERIAL.

Frank Heikens
what I do write in entity?can you explain completed?