逸轩居士 发表于 2018-5-23 16:07:05

minidao未能调用到SQL语句

    控制台输出结果是:
   .................................................begin.......................After test method: context ', activeProfiles = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = ]], class dirties context , class mode , method dirties context .
After test class: context , testMethod = , testException = , mergedContextConfiguration = ', activeProfiles = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = ]], dirtiesContext .
Closing org.springframework.context.support.GenericApplicationContext@7c935c95: startup date ; root of context hierarchy
Returning cached instance of singleton bean 'lifecycleProcessor'
Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@335ee1b3: defining beans ; root of factory hierarchy
Retrieved dependent beans for bean '(inner bean)#2d450bdf':
Invoking destroy() on bean with name 'sessionFactory'
HHH000031: Closing
Invoking destroy method 'close' on bean with name 'dataSource_enter'
{dataSource-1} closed


admin 发表于 2018-5-24 09:35:36

扫描路径配置了吗
src/main/resources/spring-minidao.xml

逸轩居士 发表于 2018-5-26 11:10:24

配置了,minidao与hibernate整合需要配置些什么?

admin 发表于 2018-5-27 21:41:02

你配置了事务?是sql执行成功了?数据库没变化?

逸轩居士 发表于 2018-5-28 09:08:09

配置了事务,SQL没有执行,我查询数据库数据在控制台没有sql语句输出,dao方法返回空指针异常。

admin 发表于 2018-5-28 15:33:39

把就是报错了,把错误日志贴出来

逸轩居士 发表于 2018-5-28 16:32:11

没有报错,控制台输出信息:.................................................begin.......................After test method: context ', activeProfiles = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = ]], class dirties context , class mode , method dirties context .
After test class: context , testMethod = , testException = , mergedContextConfiguration = ', activeProfiles = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = ]], dirtiesContext .
Closing org.springframework.context.support.GenericApplicationContext@7c935c95: startup date ; root of context hierarchy
Returning cached instance of singleton bean 'lifecycleProcessor'
Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@335ee1b3: defining beans ; root of factory hierarchy
Retrieved dependent beans for bean '(inner bean)#2d450bdf':
Invoking destroy() on bean with name 'sessionFactory'
HHH000031: Closing
Invoking destroy method 'close' on bean with name 'dataSource_enter'
{dataSource-1} closed
页: [1]
查看完整版本: minidao未能调用到SQL语句