import { FieldInfo } from 'model-util-base'
import { ConditionUtil, ConditionUtilImpl, FieldUtil, TableUtilImpl, IdType, JoinTable, SubTable } from 'model-util'
import { Container, Singleton } from 'typescript-ioc' 
import { LanguageDefine } from '../models/index' 
/**
 * @author auto generate
 * @version 1.0
 * @date 2020-10-16 11:27
 */
interface LanguageDefineCU extends ConditionUtil<LanguageDefineCU>{
    LANGUAGE_CODE:FieldUtil<LanguageDefineCU>;
    LANGUAGE_NAME:FieldUtil<LanguageDefineCU>;
}

class LanguageDefineCUImpl extends ConditionUtilImpl<LanguageDefineCUImpl> implements LanguageDefineCU{ 
    newInstance(): LanguageDefineCUImpl {
        return new LanguageDefineCUImpl();
    } 
    get LANGUAGE_CODE(): FieldUtil<LanguageDefineCU>{  
        return new FieldUtil('LANGUAGE_CODE','languageCode','', this);
    }
    get LANGUAGE_NAME(): FieldUtil<LanguageDefineCU>{  
        return new FieldUtil('LANGUAGE_NAME','languageName','', this);
    }
}

@Singleton 
class LanguageDefineMU extends TableUtilImpl<LanguageDefineCU,LanguageDefine>{ 
    tableName  = 'language_define';
    tableFields  = ['language_code','language_name'];
    modelFields  = ['languageCode','languageName'];
    modelIdFields  = ['languageCode'];
    tableIdFields  = ['language_code'];
    idType = IdType.CUSTOM;
    joinTables = [];
    subTables = [];

    createConditionUtil(): LanguageDefineCU {
        return new LanguageDefineCUImpl();
    }   

    static get LANGUAGE_CODE(): FieldUtil<LanguageDefineCU>{ 
        return new FieldUtil('LANGUAGE_CODE','languageCode','', new LanguageDefineCUImpl());
    }
    static get LANGUAGE_NAME(): FieldUtil<LanguageDefineCU>{ 
        return new FieldUtil('LANGUAGE_NAME','languageName','', new LanguageDefineCUImpl());
    }

    get LANGUAGE_CODE(): FieldUtil<LanguageDefineCU>{ 
        return LanguageDefineMU.LANGUAGE_CODE;
    }
    get LANGUAGE_NAME(): FieldUtil<LanguageDefineCU>{ 
        return LanguageDefineMU.LANGUAGE_NAME;
    }
}
export {LanguageDefineMU, LanguageDefineCU}
