hibernate could not get next sequence value

后端 未结 11 1428
夕颜
夕颜 2020-11-29 23:32

i have gwt application connect to postgres DB at the backend, and a java class \'Judgement\' mapping the table \'judgements\' in DB, when i tried to persistent a judgement i

11条回答
  •  再見小時候
    2020-11-30 00:30

    For anyone using FluentNHibernate (my version is 2.1.2), it's just as repetitive but this works:

    public class UserMap : ClassMap
    {
        public UserMap()
        {
            Table("users");
            Id(x => x.Id).Column("id").GeneratedBy.SequenceIdentity("users_id_seq");
    

提交回复
热议问题