mybatis中两张表是多对一的关系,怎么向表里插入数据.
如题,a表和b表b表的外键ID是a表的IDpublicclassArticle{privateinta_id;privateUseruser;privateStringt...
如题,a表和b表
b表的外键ID是a表的ID
public class Article {
private int a_id;
private User user;
private String title;
private String content;
}
public class User {
private int u_id;
private String userName;
private String password;
private List<Article> articleList;
}
这是我两张表的关联关系
请问怎么插入一条数据. 展开
b表的外键ID是a表的ID
public class Article {
private int a_id;
private User user;
private String title;
private String content;
}
public class User {
private int u_id;
private String userName;
private String password;
private List<Article> articleList;
}
这是我两张表的关联关系
请问怎么插入一条数据. 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询