Caused by: java.sql.SQLException: Field 'id' doesn't have a default value
来源:互联网 发布:人机界面触摸屏编程 编辑:程序博客网 时间:2024/04/29 21:24
Because:
In hdm xml:
<generator class="native"></generator>
In department table:
+-----------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+-------------+------+-----+---------+-------+
| id | int(11) | NO | PRI | NULL | |
| name | varchar(20) | NO | | NULL | |
| depart_id | int(11) | NO | MUL | NULL | |
+-----------+-------------+------+-----+---------+-------+
id is not auto-increment
Action:
alter table department modify column id int NOT NULL AUTO_INCREMENT;
insert successfully.
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/ejblover/archive/2010/01/21/5221791.aspx
- Caused by: java.sql.SQLException: Field 'id' doesn't have a default value
- Caused by: java.sql.SQLException: Field 'id' doesn't have a default value
- Caused by: java.sql.SQLException: Field 'id' doesn't have a default value
- Caused by: java.sql.SQLException: Field 'id' doesn't have a default value .
- Hibernate出现Caused by: java.sql.SQLException: Field 'id' doesn't have a default value原因
- Caused by: java.sql.SQLException: Field 'id' doesn't have a default value
- Caused by: java.sql.SQLException: Field 'id' doesn't have a default value
- Caused by: java.sql.SQLException: Field 'create_time' doesn't have a default value
- Hibernate中Caused by: java.sql.SQLException: Field 'address_id'doesn't have a default value
- Caused by: java.sql.SQLException: Field 'stu_id' doesn't have a default value
- java.sql.SQLException: Field 'id' doesn't have a default value
- java.sql.SQLException: General error, message from server: "Field 'ID' doesn't have a default value
- java.sql.SQLException: Field 'id' doesn't have a default value
- java.sql.SQLException: Field 'id' doesn't have a default value解决方案
- java.sql.SQLException: Field 'id' doesn't have a default value
- java.sql.SQLException: Field 'id' doesn't have a default value
- java.sql.SQLException: Field 'id' doesn't have a default value
- 解决异常:Cause: java.sql.SQLException: Field 'id' doesn't have a default value
- Studying note of GCC-3.4.6 source (38)
- 点击弹出一个层
- 书讯:《自动化软件测试实施指南》
- [转]让程序员增添一些浪漫情怀的代码
- 歌词文件lrc的解析类(目前在WINCE下使用)
- Caused by: java.sql.SQLException: Field 'id' doesn't have a default value
- 如何用C#实时获取CPU利用率
- xargs命令引发的示例
- HTML基础语法总结
- 在 Spring JDBC 中操作 LOB 数据
- 国内外著名的互联网公司使用hadoop都做了什么?谈HADOOP在大规模数据处理领域的具体应用。
- WIN2003下部署SiliverLight注意事项.
- jquery容器样式
- perl模块的安装查询(转载)