H2 database: NULL not allowed for column “ID” when inserting record using jdbcTemplate

前端 未结 2 1748
一个人的身影
一个人的身影 2020-12-10 01:18

I use hibernate\'s hbm2ddl to generate schema automatically. Here is my domain:

@Entity
public class Reader {

  @Id
  @GeneratedValue(strategy=GenerationTyp         


        
2条回答
  •  隐瞒了意图╮
    2020-12-10 02:00

    Try to use strategy=GenerationType.IDENTITY instead of the strategy=GenerationType.AUTO

    Also could be wrong hibernate.dialect Try the

    hibernate.dialect=org.hibernate.dialect.H2Dialect
    

提交回复
热议问题