首页 > 编程语言 >java——mybatis——Mybatis的多表操作——完成account的一对一操作-通过写account的子类方式查询

java——mybatis——Mybatis的多表操作——完成account的一对一操作-通过写account的子类方式查询

时间:2022-12-03 18:45:01浏览次数:37  
标签:account 多表 子类 dao 接口 Mybatis

数据库数据准备:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

新建一个account实体类:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

生成account的dao接口:

 

 

 

 

 

 

 

 

 

生成account的dao接口的xml文件:

 

 

 

 

 

 

 

 

 

 

 

 

测试执行:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

===========================================================================================================

 

 

 

 

 

 

 

 

 

生成account的子类:

 

 

 

 

 

 

 

配置mapper文件:

 

 

 

 

 

 

 

 

配置dao接口文件:

 

 

 

 

 

 

 

 

测试执行:

 

 

 

 

 

 

 

 

 

 

执行结果:

 

标签:account,多表,子类,dao,接口,Mybatis
From: https://www.cnblogs.com/xiaobaibailongma/p/16948553.html

相关文章