import {BaseEntity,Entity,Column,Id,OneToMany,EntityProxy, ManyToMany} from 'relaen'; import { AmAuthority } from './amauthority'; import { AmMenu } from './ammenu'; import { AmUser } from './amuser'; @Entity("AM_GROUP") export class AmGroup extends BaseEntity{ @Id() @Column({ name:'GROUP_ID', type:'int', nullable:false }) public groupId:number; @Column({ name:'GROUP_NAME', type:'string', nullable:false, length:128 }) public groupName:string; @Column({ name:'REMARKS', type:'string', nullable:true, length:256 }) public remarks:string; @ManyToMany({ entity:'AmAuthority', mappedBy:'amGroups' }) public amAuthorities:Array; @ManyToMany({ entity:'AmMenu', mappedBy:'amGroups' }) public amMenus:Array; @ManyToMany({ entity:'AmUser', mappedBy:'amGroups' }) public amUsers:Array; constructor(idValue?:number){ super(); this.groupId = idValue; } public async getAmAuthorities():Promise>{ return this['amAuthorities']?this['amAuthorities']:await EntityProxy.get(this,'amAuthorities'); } public async getAmMenus():Promise>{ return this['amMenus']?this['amMenus']:await EntityProxy.get(this,'amMenus'); } public async getAmUsers():Promise>{ return this['amUsers']?this['amUsers']:await EntityProxy.get(this,'amUsers'); } }