mybatis

一对多 多对一 框架练习 代码如下:

 

导入的包:

 配置文件和主配置文件

 

 

实体类:classes student teacher

 

 

 

导入的工具包,方便mbatis连接

 

在dao包下的映射文件和接口

classes:

 

 student:

 

 

 

teacher:

 

 

最后的测试类:

 

完成!

 

posted @ 2023-10-10 18:03  牵机  阅读(7)  评论(0)    收藏  举报