nutzdao+druid使用非数据库实体VO接收返回的对象一直报“Table ‘xxxxx’ doesn't exist”
sql.setCallback(Sqls.callback.entities()) ; //返回一组对象
Entity<T> entity = dao.getEntity(clazz) ;
sql.setEntity(entity) ;
dao.execute(sql) ;
dao.getEntity(clazz) ;时报错
报错信息如下:
- No @Table found, fallback to use table name='tm_user_v_o' for type 'com.xxxx.TmUserVO'
[20161012 13:19:35.809] {Thread-25} <ERROR> druid.sql.Statement: {conn-10002, stmt-20003} execute error. SELECT * FROM tm_user_v_o LIMIT 1
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'whfq_tester.tm_user_v_o' doesn't exist
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_73]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_73]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_73]
at java.lang.reflect.Constructor.newInstance(Constructor.java:422) ~[na:1.8.0_73]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) ~[mysql-connector-java-5.1.16.jar:na]
at com.mysql.jdbc.Util.getInstance(Util.java:386) ~[mysql-connector-java-5.1.16.jar:na]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052) ~[mysql-connector-java-5.1.16.jar:na]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3597) ~[mysql-connector-java-5.1.16.jar:na]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3529) ~[mysql-connector-java-5.1.16.jar:na]
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1990) ~[mysql-connector-java-5.1.16.jar:na]
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2151) ~[mysql-connector-java-5.1.16.jar:na]
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2619) ~[mysql-connector-java-5.1.16.jar:na]
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2569) ~[mysql-connector-java-5.1.16.jar:na]
at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1510) ~[mysql-connector-java-5.1.16.jar:na]
at com.alibaba.druid.filter.FilterChainImpl.statement_executeQuery(FilterChainImpl.java:2363) [druid-1.0.15.jar:1.0.15]
at com.alibaba.druid.filter.FilterAdapter.statement_executeQuery(FilterAdapter.java:2481) [druid-1.0.15.jar:1.0.15]
at com.alibaba.druid.filter.FilterEventAdapter.statement_executeQuery(FilterEventAdapter.java:302) [druid-1.0.15.jar:1.0.15]
at com.alibaba.druid.filter.FilterChainImpl.statement_executeQuery(FilterChainImpl.java:2360) [druid-1.0.15.jar:1.0.15]
at com.alibaba.druid.filter.FilterAdapter.statement_executeQuery(FilterAdapter.java:2481) [druid-1.0.15.jar:1.0.15]
at com.alibaba.druid.filter.FilterEventAdapter.statement_executeQuery(FilterEventAdapter.java:302) [druid-1.0.15.jar:1.0.15]
at com.alibaba.druid.filter.FilterChainImpl.statement_executeQuery(FilterChainImpl.java:2360) [druid-1.0.15.jar:1.0.15]
at com.alibaba.druid.wall.WallFilter.statement_executeQuery(WallFilter.java:498) [druid-1.0.15.jar:1.0.15]
at com.alibaba.druid.filter.FilterChainImpl.statement_executeQuery(FilterChainImpl.java:2360) [druid-1.0.15.jar:1.0.15]
at com.alibaba.druid.filter.FilterAdapter.statement_executeQuery(FilterAdapter.java:2481) [druid-1.0.15.jar:1.0.15]
at com.alibaba.druid.filter.FilterEventAdapter.statement_executeQuery(FilterEventAdapter.java:302) [druid-1.0.15.jar:1.0.15]
at com.alibaba.druid.filter.FilterChainImpl.statement_executeQuery(FilterChainImpl.java:2360) [druid-1.0.15.jar:1.0.15]
at com.alibaba.druid.proxy.jdbc.StatementProxyImpl.executeQuery(StatementProxyImpl.java:211) [druid-1.0.15.jar:1.0.15]
at com.alibaba.druid.pool.DruidPooledStatement.executeQuery(DruidPooledStatement.java:143) [druid-1.0.15.jar:1.0.15]
at org.nutz.dao.impl.jdbc.AbstractJdbcExpert.setupEntityField(AbstractJdbcExpert.java:75) [nutz-1.b.52.jar:na]
at org.nutz.dao.impl.entity.AnnotationEntityMaker._checkupEntityFieldsWithDatabase(AnnotationEntityMaker.java:534) [nutz-1.b.52.jar:na]
at org.nutz.dao.impl.entity.AnnotationEntityMaker.make(AnnotationEntityMaker.java:277) [nutz-1.b.52.jar:na]
at org.nutz.dao.impl.EntityHolder.getEntity(EntityHolder.java:65) [nutz-1.b.52.jar:na]
at org.nutz.dao.impl.NutDao.getEntity(NutDao.java:638) [nutz-1.b.52.jar:na]
PS:用其他连接池不会报错,只会提示:- No @Table found, fallback to use table name='tm_user_v_o' for type 'com.xxxx.TmUserVO'