All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.zengtengpeng.relation.oneToMany.BuildOneToManyBean Maven / Gradle / Ivy

There is a newer version: 2.1.6
Show newest version
package com.zengtengpeng.relation.oneToMany;

import com.zengtengpeng.autoCode.bean.BuildJavaField;
import com.zengtengpeng.autoCode.bean.BuildJavaMethod;
import com.zengtengpeng.autoCode.config.AutoCodeConfig;
import com.zengtengpeng.relation.bean.RelationTable;
import com.zengtengpeng.relation.build.BuildBaseBean;
import com.zengtengpeng.relation.config.RelationConfig;
import com.zengtengpeng.relation.utils.RelationBuilUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * 构建一对多Bean
 */
@FunctionalInterface
public interface BuildOneToManyBean extends BuildBaseBean {



    /**
     * 主表字段
     * @return
     */
    default List primaryFields(AutoCodeConfig autoCodeConfig){
        RelationConfig relationConfig = autoCodeConfig.getGlobalConfig().getRelationConfig();
        RelationTable foreign = relationConfig.getForeign();
        return RelationBuilUtils.getBeanListJavaFields(foreign,autoCodeConfig.getGlobalConfig());
    }



    /**
     * 主表方法
     * @return
     */
    default List primaryMethods(AutoCodeConfig autoCodeConfig){
        RelationConfig relationConfig = autoCodeConfig.getGlobalConfig().getRelationConfig();
        return RelationBuilUtils.getBeanListJavaMethods(relationConfig.getForeign());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy