赞
踩
大家好,我是锋哥。今天分享关于 【Mapper 编写有哪几种方式?】面试题,希望对大家有帮助;
- <mappers>
- <mapper resource="mapper.xml 文件的地址" />
- <mapper resource="mapper.xml 文件的地址" />
- </mappers>
- <bean id=" " class="mapper 接口的实现">
- <property name="sqlSessionFactory"
- ref="sqlSessionFactory"></property>
- </bean>
- <mappers>
- <mapper resource="mapper.xml 文件的地址" />
- <mapper resource="mapper.xml 文件的地址" />
- </mappers>
- <bean id="" class="org.mybatis.spring.mapper.MapperFactoryBean">
- <property name="mapperInterface" value="mapper 接口地址" />
- <property name="sqlSessionFactory" ref="sqlSessionFactory" />
- </bean>
- <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
- <property name="basePackage" value="mapper 接口包地址
- "></property>
- <property name="sqlSessionFactoryBeanName"
- value="sqlSessionFactory"/>
- </bean>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。