import {BaseEntity,Entity,Column,Id,JoinColumn,ManyToOne,OneToMany,EntityProxy} from 'relaen'; import {AmAlgorithmType} from './amalgorithmtype'; import {AmUser} from './amuser'; import {AmFile} from './amfile'; import {AmAlgorithmUseLog} from './amalgorithmuselog'; @Entity("AM_ALGORITHM") export class AmAlgorithm extends BaseEntity{ @Id() @Column({ name:'ALGORITHM_ID', type:'int', nullable:false }) public algorithmId:number; @ManyToOne({entity:'AmAlgorithmType'}) @JoinColumn({ name:'ALGORITHM_TYPE_ID', refName:'ALGORITHM_TYPE_ID', nullable:true }) public amAlgorithmType:AmAlgorithmType; @ManyToOne({entity:'AmUser'}) @JoinColumn({ name:'USER_ID', refName:'USER_ID', nullable:true }) public amUser:AmUser; @ManyToOne({entity:'AmFile'}) @JoinColumn({ name:'FILE_ID', refName:'FILE_ID', nullable:true }) public amFile:AmFile; @Column({ name:'ALGORITHM_NAME', type:'string', nullable:false, length:128 }) public algorithmName:string; @Column({ name:'DESCRIPTION', type:'string', nullable:true, length:512 }) public description:string; @OneToMany({ entity:'AmAlgorithmUseLog', mappedBy:'amAlgorithm' }) public amAlgorithmUseLogs:Array; constructor(idValue?:number){ super(); this.algorithmId = idValue; } public async getAmAlgorithmType():Promise{ return this['amAlgorithmType']?this['amAlgorithmType']:await EntityProxy.get(this,'amAlgorithmType'); } public async getAmUser():Promise{ return this['amUser']?this['amUser']:await EntityProxy.get(this,'amUser'); } public async getAmFile():Promise{ return this['amFile']?this['amFile']:await EntityProxy.get(this,'amFile'); } public async getAmAlgorithmUseLogs():Promise>{ return this['amAlgorithmUseLogs']?this['amAlgorithmUseLogs']:await EntityProxy.get(this,'amAlgorithmUseLogs'); } }