账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    JPA 数据库已经设置默认值了. 为什么保存时报错 Column cannot be null ?
    39
    0
    错误信息: Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement] with root causejava.sql.SQLIntegrityConstraintViolationException: Column 'aaa' cannot be null at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:117) at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)数据库字段信息: `aaa` VARCHAR(255) NOT NULL DEFAULT '' COLLATE 'utf8mb4_general_ci',public class XXX { @Column(name = "`aaa`") private String aaa;}请问在数据库提供了默认值的情况下,为什么还会报 Column cannot be null 呢?
    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • 程实 普通会员 1楼
      502 Bad Gateway

      502 Bad Gateway


      nginx
    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部