import {BaseEntity,Entity,Column,Id,JoinColumn,ManyToOne,EntityProxy} from 'relaen'; import {AmUser} from './amuser'; import {AmAlgorithm} from './amalgorithm'; @Entity("AM_ALGORITHM_USE_LOG") export class AmAlgorithmUseLog extends BaseEntity{ @Id() @Column({ name:'ID_', type:'int', nullable:false }) public id:number; @ManyToOne({entity:'AmUser'}) @JoinColumn({ name:'USER_ID', refName:'USER_ID', nullable:true }) public amUser:AmUser; @ManyToOne({entity:'AmAlgorithm'}) @JoinColumn({ name:'ALGORITHM_ID', refName:'ALGORITHM_ID', nullable:true }) public amAlgorithm:AmAlgorithm; @Column({ name:'USE_TIME', type:'int', nullable:true }) public useTime:number; constructor(idValue?:number){ super(); this.id = idValue; } public async getAmUser():Promise{ return this['amUser']?this['amUser']:await EntityProxy.get(this,'amUser'); } public async getAmAlgorithm():Promise{ return this['amAlgorithm']?this['amAlgorithm']:await EntityProxy.get(this,'amAlgorithm'); } }