Persistence @Column nullable = false can insert null

前端 未结 3 747
轮回少年
轮回少年 2021-01-18 08:08

I want to do this column can´t be null but when I insert in database one register values null this allows me inserted. I read documentation and I don´t know why doesn´t work

3条回答
  •  鱼传尺愫
    2021-01-18 08:51

    Probably in the base you already have that field with nulls In these cases you must change the nullity of the field manually MySql Query:

     alter table [table] modify [column] [[Column_Type] ej: vachar] not null;
    

提交回复
热议问题