Hibernate创建表成功,但数据库中却没有表的解决方法

在使用Hibernate创建Mysql数据库表时,发现表t_message未能成功创建。检查发现't_show'属性可能是数据库的关键字,将其修改为'showed'后,通过SchemaExport成功创建。此外,需要注意boolean属性命名,避免与Java get方法冲突。
摘要由CSDN通过智能技术生成

    注意:测试数据库为Mysql

   

      编写Hibernate配置文件,然后通过SchemaExport类创建表,以前都能成功实现,但是今天却遇到了问题。

编写了三个“.hbm.xml”文件,然后通过SchemaExport类创建表,控制台输出如下Sql语句:

 

drop table if exists t_admin
drop table if exists t_message
drop table if exists t_websiteinfo
create table t_admin (userName varchar(20) not null, password varchar(20), primary key (userName))
create table t_message (id integer not null auto_increment, userName varchar(20), email varchar(20), websize varchar(100), qq varchar(10), content longtext, facePic varchar(30), headPic varchar(30), postDate varchar(20), replayContent longtext, replayDate varchar(20), show bit, userIP varchar(15), top bit, primary key (id))
create table t_websiteinfo (id integer not null auto_increment, name varchar(20), needEmail bit, supportHtml bit, needCheckup bit, contentLength integer, pageSize integer, replayTip varchar(30), replayColor varc
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值