mybatis 实体嵌套查询

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

本例子只是一个实体类嵌套另外一个或者多个实体类。在实体类嵌套一个实体列表的我还没研究出来。

首先上实体类:


public class AppPost {
    private String postId;
    private String postTitle;
    private int upTime;
    private int postType;
    private int pointsNum;
    private int collectionNum;
    private int replyNum;
    private int transferNum;
    private int isHost;
    private int contentType;
    private AppUserMini user;
}


public class AppUserMini {
    private String userId;
    private String userName;
    private Integer userSex;
    private Integer userAge;
    private String userImg;
    private String userAddress;
}

然后其他乱七八糟的就不说了,直接上xml的代码:


    
    
    
    
    
    
    
    
    
    


    
  

  
    
    
    
    
    
    
  

  

估计看代码就动了,我也不多逼逼了!

转载于:https://my.oschina.net/u/1462828/blog/1595220

你可能感兴趣的:(mybatis 实体嵌套查询)