[jnhs]hibernate只能创建一张/表不创建表com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'kaihu.t_client_info' doesn't exist和org.hibernate.exception.SQLGrammarException: could not execute statement

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'kaihu.t_client_info' doesn't exist

 有两个model,使用第一个dao的时候可以自动创建表

但是使用第二个model的时候不能,会报错

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'kaihu.t_client_info' doesn't exist

 

可以正常创建表的

 

不可以正常创建表的

 

原因:

设置了映射文件的主键策略是native,所以这个字段就必须是int的,可以自增的才行

原来这个id 是 string类型的,准备用uuid呢,看起来得换一个办法使用uuid

 

posted @ 2018-11-29 12:02  不打鱼光晒网  阅读(278)  评论(0)    收藏  举报