mybatis学习11:使用注解开发
-
使用注解开发:
-
注解在接口上实现;
/**
* 使用注解开发
*/
public interface UserMapper {
-
需要在核心配置文件中绑定接口:
<!--绑定接口-->
<mappers>
<mapper class="com.ljxdemo.dao.UserMapper"/>
</mappers> -
测试使用!
-
-
总结:
-
本质:反射机制实现;
-
底层:动态代理!
-
使用注解开发:
注解在接口上实现;
/**
* 使用注解开发
*/
public interface UserMapper {
需要在核心配置文件中绑定接口:
<!--绑定接口-->
<mappers>
<mapper class="com.ljxdemo.dao.UserMapper"/>
</mappers>
测试使用!
总结:
本质:反射机制实现;
底层:动态代理!