解决 Cause: org.postgresql.util.PSQLException: ERROR: null value in column "time_period" violates no

postgre添加数据时出现如下错误

### Cause: org.postgresql.util.PSQLException: ERROR: null value in column "time_period" violates not-null constraint
; SQL []; ERROR: null value in column "time_period" violates not-null constraint; nested exception is org.postgresql.util.PSQLException: ERROR: null value in column "time_period" violates not-null constraint
    at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:249)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
    at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:71)
    at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:364)
    at $Proxy47.insert(Unknown Source)
    at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:236)

根据 null value in column "time_period" violates not-null constraint 说明time_period字段不能为空

插入数据时没有给time_period传值所以才出现此类错误

来源://作者:/更新时间:2014-02-14
相关文章
评论:
验证码:
匿名评论:

最新文章

新热推荐

文章排行