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

 

可以正常创建表的

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

 

不可以正常创建表的

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

 

原因:

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

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

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

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-05
  • 2022-12-23
猜你喜欢
  • 2021-09-29
  • 2021-05-17
  • 2021-05-31
  • 2021-04-11
  • 2022-01-22
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案