Advertisement

mybatis框架学习二(包括一对多、多对多和延迟加载)

阅读量:

一,关联查询(一对一)

association属性是一个配置项允许执行查询单一实体的映射关系

1,实体类

Goods:(里面有类型Types的)

复制代码
    public class Goods implements Serializable{
    private Integer id;
    private String goodsname;
    private String godsfullname;
    private Integer num;
    private Integer typeid;
    private Types types;
    
    public Types getTypes() {
        return types;
    }
    
    public void setTypes(Types types) {
        this.types = types;
    }
    
    public Goods() {
        super();
    }
    
    public Goods(Integer id, String goodsname, String godsfullname, Integer num, Integer typeid) {

全部评论 (0)

还没有任何评论哟~