读书人

org.hibernate.exception.ConstraintV

发布时间: 2014-01-26 14:34:54 作者: rapoo

org.hibernate.exception.ConstraintViolationException: could not insert: [com.crownsoft.qsm.Teacher]?

在控制台上可以看到:
Hibernate: insert into gd.user (login_pwd, role, id) values (?, ?, ?)
Hibernate: insert into teacher (name, techtitle, sex, tel, email, department, id) values (?, ?, ?, ?, ?, ?, ?)

我用sql语句直接在数据库中写也没问题,但就是报这个错误!

------解决方法--------------------------------------------------------
违反了约束, 映射文件里是不是有长度什么的约束?

        

读书人网 >Java Exception

热点推荐