hibernate自动建表时的错误解决办法
来源:互联网 发布:淘宝带图评价福利 编辑:程序博客网 时间:2024/04/30 12:06
错误代码:Incorrect column specifier for column 'addressId'
解决办法及叙述:
用Hibernate生成数据表时,Hibernate执行了下面的SQL语句:
create table Address (addressId varchar(255) not null auto_increment, name varchar(255), primary key (addressId))
用了log4j检查:hibernat提示以下错误:
10:56:24,546 ERROR SchemaExport:274 - Unsuccessful: create table Address (addressId varchar(255) not null auto_increment, name varchar(255), primary key (addressId))
10:56:24,546 ERROR SchemaExport:275 - Incorrect column specifier for column 'addressId'
原来自动增长列用int数据类型,不用varchar.
Hibernate根据Address.java中的代码
private String addressId;
private String name;
这样指定了“addressId varchar(255) not null auto_increment”
改为别的,要是自动增长列,要么将addressId改为Integer类型,或者将映射文件改为 其他主键生成策
主键生成策略详情见Hibernate主键生成策略
- hibernate自动建表时的错误解决办法
- hibernate 无法自动创建表 的解决办法
- hibernate开发遇到的错误及解决办法
- hibernate开发遇到的错误及解决办法
- org.hibernate.LazyInitializationException错误的解决办法
- hibernate开发遇到的错误及解决办法
- Hibernate 入门错误解决办法。
- Hibernate插入数据时自动清除以前数据的解决办法
- hibernate 使用mysql6.0 无法自动建表的解决办法
- hibernate开发错误及解决办法
- hibernate源代码编译时出现错误的解决办法
- Hibernate出现javax.naming.NoInitialContextException 错误的解决办法
- Hibernate出现javax.naming.NoInitialContextException 错误的解决办法
- Eclipse Hibernate工具的错误: “Fetching children of Database”解决办法
- Hibernate出现javax.naming.NoInitialContextException 错误的解决办法
- MyEclipse自动生成Hibernate配置文件时的一个错误
- eclipse hibernate 出现not found org/hibernate/session 错误的解决办法
- 使用hibernate出现could not parse configuration:hibernate.cfg.xml 错误的解决办法
- XSS常见攻击与防御
- (三)最流行的网络请求框架Rxjava2+Retrofit之文件上传
- [BZOJ1925][Sdoi2010]地精部落(抖动序列dp)
- SVD 奇异值分解( The singular value decomposition )
- mysql高级排序&高级匹配查询示例
- hibernate自动建表时的错误解决办法
- CodeForces
- BM25算法 仅供自己记录学习
- apache 转发到tomcat
- 笔记本电脑数据丢失怎么恢复
- kafaka模板推送
- jQuery选择器本质及使用技巧,三种$()__有用
- Linux: date 和 随机数
- 基于jQuery 各种表单取值折磨