
Hibernate自动生成的sql语句怎么会多了前缀
我用SSH写了一个查询方法,后来执行的时候自动打印出来的sql语句多了个前缀,导致查询不到数据,我讲sql复制过去然后去掉多余的前缀再查询诗句是可以查出来的,这是为什么啊...
我用SSH写了一个查询方法,后来执行的时候自动打印出来的sql语句多了个前缀,导致查询不到数据,我讲sql复制过去然后去掉多余的前缀再查询诗句是可以查出来的,这是为什么啊
下面是报的错误
org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: could not load an entity: [com.oristand.nitpro.entity.Users#9]; bad SQL grammar
[select users0_.userId as userId0_, users0_.name as name0_0_, users0_.zhiw as zhiw0_0_ from jbpm__users users0_ where users0_.userId=?];
nested exception is com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 'jbpm.jbpm__users' doesn't exist
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 'jbpm.jbpm__users' doesn't exist
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
我的表名叫users,生成的语句中的表名却是jbpm_users,我的数据库名叫jbpm,麻烦高手解答一下,谢谢! 展开
下面是报的错误
org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: could not load an entity: [com.oristand.nitpro.entity.Users#9]; bad SQL grammar
[select users0_.userId as userId0_, users0_.name as name0_0_, users0_.zhiw as zhiw0_0_ from jbpm__users users0_ where users0_.userId=?];
nested exception is com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 'jbpm.jbpm__users' doesn't exist
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 'jbpm.jbpm__users' doesn't exist
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
我的表名叫users,生成的语句中的表名却是jbpm_users,我的数据库名叫jbpm,麻烦高手解答一下,谢谢! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询