import {BaseEntity,Entity,Column,Id,OneToMany,EntityProxy} from 'relaen'; import {AmUser} from './amuser'; @Entity("AM_COMPANY") export class AmCompany extends BaseEntity{ @Id() @Column({ name:'COMPANY_ID', type:'int', nullable:false }) public companyId:number; @Column({ name:'COMPANY_NAME', type:'string', nullable:false, length:128 }) public companyName:string; @Column({ name:'ADDRESS', type:'string', nullable:true, length:256 }) public address:string; @Column({ name:'LINK_MAN', type:'string', nullable:false, length:128 }) public linkMan:string; @Column({ name:'LINK_TEL', type:'string', nullable:false, length:15 }) public linkTel:string; @Column({ name:'MAIL_ADDRESS', type:'string', nullable:true, length:256 }) public mailAddress:string; @Column({ name:'ZIPCODE', type:'string', nullable:true, length:6 }) public zipcode:string; @Column({ name:'FAX_NO', type:'string', nullable:true, length:15 }) public faxNo:string; @Column({ name:'FIX_TEL_NO', type:'string', nullable:true, length:15 }) public fixTelNo:string; @Column({ name:'EMAIL', type:'string', nullable:true, length:50 }) public email:string; @Column({ name:'REMARKS', type:'string', nullable:true, length:512 }) public remarks:string; @OneToMany({ entity:'AmUser', mappedBy:'amCompany' }) public amUsers:Array; constructor(idValue?:number){ super(); this.companyId = idValue; } public async getAmUsers():Promise>{ return this['amUsers']?this['amUsers']:await EntityProxy.get(this,'amUsers'); } }