Hibernate自建数据库的问题

clazz--->class com.lyc.oa.domain.Role
2018-04-06 15:04:12,688 ERROR [SchemaUpdate.java:212] : Unsuccessful: create table lyc_role (id longint not null, name varchar(255), description varchar(255), primary key (id))
2018-04-06 15:04:12,690 ERROR [SchemaUpdate.java:213] : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longint not null, name varchar(255), description varchar(255), primary key (id))' at line 1
clazz--->class com.lyc.oa.domain.User
SessionImpl(PersistenceContext[entityKeys=[],collectionKeys=[]];ActionQueue[insertions=[] updates=[] deletions=[] collectionCreations=[] collectionRemovals=[] collectionUpdates=[]])
clazz--->class com.lyc.oa.domain.Role
2018-04-06 15:04:12,967 ERROR [SchemaUpdate.java:212] : Unsuccessful: create table lyc_role (id longint not null, name varchar(255), description varchar(255), primary key (id))
2018-04-06 15:04:12,967 ERROR [SchemaUpdate.java:213] : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longint not null, name varchar(255), description varchar(255), primary key (id))' at line 1
clazz--->class com.lyc.oa.domain.User
Hibernate: insert into lyc_user (name, id) values (?, ?)
Hibernate: insert into lyc_user (name, id) values (?, ?)
clazz--->class com.lyc.oa.domain.Role
2018-04-06 15:04:13,202 ERROR [SchemaUpdate.java:212] : Unsuccessful: create table lyc_role (id longint not null, name varchar(255), description varchar(255), primary key (id))
2018-04-06 15:04:13,203 ERROR [SchemaUpdate.java:213] : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longint not null, name varchar(255), description varchar(255), primary key (id))' at line 1
clazz--->class com.lyc.oa.domain.User
com.lyc.oa.test.TestAction@73331054

出现这些错误,要怎么解决

2018-04-06 15:04:12,967 ERROR [SchemaUpdate.java:212] : Unsuccessful: create table lyc_role (id longint not null, name varchar(255), description varchar(255), primary key (id))
2018-04-06 15:04:12,967 ERROR [SchemaUpdate.java:213] : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longint not null, name varchar(255), description varchar(255), primary key (id))' at line 1

该怎么解决

这个要去检查你的数据库了,我看不到啊

是不是框架配置出错误了

你建表的sql语句写的有问题,错误里已经写出来了

根据报错提示,创建表格的语法有问题,检查是否使用数据库自留关键词或者执行语句定位语法错误原因。

数据库建好之后直接用myeclipse的逆向工程生成pojo类就可以了