<select id=”TestSelect” resultType=”guet.com.po.Document”>
SELECT * FROM document WHERE (doc_id =2)
</select>
日志:
DEBUG [http-apr-8080-exec-2] – JDBC Connection [435841503, URL=jdbc:mysql://localhost:3306/instru_sys, UserName=root@localhost, MySQL-AB JDBC Driver] will not be managed by Spring
DEBUG [http-apr-8080-exec-2] – ==> Preparing: SELECT * FROM document WHERE (doc_id =2)
DEBUG [http-apr-8080-exec-2] – ==> Parameters:
DEBUG [http-apr-8080-exec-2] – <== Columns: doc_id, doc_numb, doc_time, doc_type, check_p
DEBUG [http-apr-8080-exec-2] – <== Row: 2, 0002, 2017-04-21 15:05:38.0, 0, ??
DEBUG [http-apr-8080-exec-2] – <== Total: 1
DEBUG [http-apr-8080-exec-2] – Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@3637a3fd]
DEBUG [http-apr-8080-exec-2] – Returning JDBC Connection to DataSource
DEBUG [http-apr-8080-exec-2] – Don”t need to create transaction for [guet.com.service.impl.DocumentServiceImpl.GetMaxid]: This method isn”t transactional.
DEBUG [http-apr-8080-exec-2] – Creating a new SqlSession
DEBUG [http-apr-8080-exec-2] – SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@53914c10] was not registered for synchronization because synchronization is not active
DEBUG [http-apr-8080-exec-2] – Fetching JDBC Connection from DataSource
DEBUG [http-apr-8080-exec-2] – JDBC Connection [1214379398, URL=jdbc:mysql://localhost:3306/instru_sys, UserName=root@localhost, MySQL-AB JDBC Driver] will not be managed by Spring
DEBUG [http-apr-8080-exec-2] – ==> Preparing: SELECT MAX(doc_id) FROM document
DEBUG [http-apr-8080-exec-2] – ==> Parameters:
DEBUG [http-apr-8080-exec-2] – <== Columns: MAX(doc_id)
DEBUG [http-apr-8080-exec-2] – <== Row: 5
DEBUG [http-apr-8080-exec-2] – <== Total: 1
DEBUG [http-apr-8080-exec-2] – Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@53914c10]
DEBUG [http-apr-8080-exec-2] – Returning JDBC Connection to DataSource
null
IN20174215
DEBUG [http-apr-8080-exec-2] – Method [selecttest] returned [null]
SELECT * FROM document WHERE (doc_id =2)
</select>
日志:
DEBUG [http-apr-8080-exec-2] – JDBC Connection [435841503, URL=jdbc:mysql://localhost:3306/instru_sys, UserName=root@localhost, MySQL-AB JDBC Driver] will not be managed by Spring
DEBUG [http-apr-8080-exec-2] – ==> Preparing: SELECT * FROM document WHERE (doc_id =2)
DEBUG [http-apr-8080-exec-2] – ==> Parameters:
DEBUG [http-apr-8080-exec-2] – <== Columns: doc_id, doc_numb, doc_time, doc_type, check_p
DEBUG [http-apr-8080-exec-2] – <== Row: 2, 0002, 2017-04-21 15:05:38.0, 0, ??
DEBUG [http-apr-8080-exec-2] – <== Total: 1
DEBUG [http-apr-8080-exec-2] – Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@3637a3fd]
DEBUG [http-apr-8080-exec-2] – Returning JDBC Connection to DataSource
DEBUG [http-apr-8080-exec-2] – Don”t need to create transaction for [guet.com.service.impl.DocumentServiceImpl.GetMaxid]: This method isn”t transactional.
DEBUG [http-apr-8080-exec-2] – Creating a new SqlSession
DEBUG [http-apr-8080-exec-2] – SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@53914c10] was not registered for synchronization because synchronization is not active
DEBUG [http-apr-8080-exec-2] – Fetching JDBC Connection from DataSource
DEBUG [http-apr-8080-exec-2] – JDBC Connection [1214379398, URL=jdbc:mysql://localhost:3306/instru_sys, UserName=root@localhost, MySQL-AB JDBC Driver] will not be managed by Spring
DEBUG [http-apr-8080-exec-2] – ==> Preparing: SELECT MAX(doc_id) FROM document
DEBUG [http-apr-8080-exec-2] – ==> Parameters:
DEBUG [http-apr-8080-exec-2] – <== Columns: MAX(doc_id)
DEBUG [http-apr-8080-exec-2] – <== Row: 5
DEBUG [http-apr-8080-exec-2] – <== Total: 1
DEBUG [http-apr-8080-exec-2] – Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@53914c10]
DEBUG [http-apr-8080-exec-2] – Returning JDBC Connection to DataSource
null
IN20174215
DEBUG [http-apr-8080-exec-2] – Method [selecttest] returned [null]
解决方案
40
resultType=”guet.com.po.Document”
数据库的字段和实体类对应吗?
数据库的字段和实体类对应吗?