0
我正在用mybatis 3開發一個web應用程序, Spring 3.1.1-RELEASE。 我指的是the documentation。mybatis mapper factory bean and aop
由MapperFactoryBean
創建的數據訪問層對象都不能被指向爲AOP的切入點。這樣
我編寫Spring配置:
<bean id="memberDao" name="memberDao" class="org.mybatis.spring.mapper.MapperFactoryBean">
<property name="mapperInterface" value="com.musicovery.bookervery.dao.MemberDao" />
<property name="sqlSessionFactory" ref="sqlSessionFactory" />
</bean>
<!-- AOP Aspect -->
<bean id="customSqlExceptionTranslator" class="com.musicovery.bookervery.service.exception.CustomSqlExceptionTranslator" />
<!-- AOP Configuration -->
<aop:config>
<aop:advisor advice-ref="customSqlExceptionTranslator" pointcut="bean(memberDao)" />
</aop:config>
利用這種配置, Eclipse不表明AOP
的切入點標誌當我配置切入點另一個bean , 有用。 但只是由MapperFactoryBean
創建的對象。
我想應用AOP和MapperFactoryBean提供的數據訪問層對象。
我該如何解決?
預先感謝