package com.ebts.generator.entity;

import com.ebts.common.core.entity.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * top万能查询关系映射对象 gen_relational_mapping
 *
 * @author clay
 * @date 2021-07-21
 */
public class RelationalMap extends BaseEntity{

    /** 主表id */
    private Long mainId;

    /** 字表id */
    private Long childId;

    /** 主表字段 */
    private String mainKey;

    /** 字表字段 */
    private String childKey;

    /** 关系 1:hasOne 2:hasMany 3: belongsTo */
    private String type;


    public void setMainId(Long mainId){
        this.mainId = mainId;
    }

    public Long getMainId(){
        return mainId;
    }
    public void setChildId(Long childId){
        this.childId = childId;
    }

    public Long getChildId(){
        return childId;
    }
    public void setMainKey(String mainKey){
        this.mainKey = mainKey;
    }

    public String getMainKey(){
        return mainKey;
    }
    public void setChildKey(String childKey){
        this.childKey = childKey;
    }

    public String getChildKey(){
        return childKey;
    }
    public void setType(String type){
        this.type = type;
    }

    public String getType(){
        return type;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("mainId", getMainId())
                .append("childId", getChildId())
                .append("mainKey", getMainKey())
                .append("childKey", getChildKey())
                .append("type", getType())
                .toString();
    }
}
