import {BaseEntity,Entity,Column,Id,JoinColumn,ManyToOne,OneToMany,EntityProxy} from 'relaen'; import {AmModel} from './ammodel'; import {AmOrgItem} from './amorgitem'; @Entity('AM_PROPERTY') export class AmProperty extends BaseEntity{ @Id() @Column({ name:'PROP_ID', type:'int', nullable:false }) public propId:number; @ManyToOne({entity:'AmModel'}) @JoinColumn({ name:'MODEL_ID', refName:'MODEL_ID', nullable:true }) public amModel:AmModel; @Column({ name:'PROP_NAME', type:'string', nullable:true, length:128 }) public propName:string; @Column({ name:'SHOW_NAME', type:'string', nullable:true, length:128 }) public showName:string; @Column({ name:'PROP_TYPE', type:'string', nullable:true, length:32 }) public propType:string; @Column({ name:'REF_MODEL', type:'string', nullable:true, length:128 }) public refModel:string; @Column({ name:'IS_ID', type:'int', nullable:true }) public isId:number; @Column({ name:'EDITABLE', type:'int', nullable:true }) public editable:number; @Column({ name:'USE_SYSTEM_TIME', type:'int', nullable:true }) public useSystemTime:number; @Column({ name:'USE_LOGON_USER', type:'int', nullable:true }) public useLogonUser:number; @Column({ name:'EDIT_OPTION', type:'string', nullable:true, length:512 }) public editOption:string; @Column({ name:'VALIDATOR', type:'string', nullable:true, length:128 }) public validator:string; @Column({ name:'WIDTH', type:'int', nullable:true }) public width:number; @Column({ name:'SHOW_IN_REF', type:'int', nullable:true }) public showInRef:number; @Column({ name:'SHOW_IN_GRID', type:'int', nullable:true }) public showInGrid:number; @Column({ name:'SHOW_IN_QUERY', type:'string', nullable:true, length:10 }) public showInQuery:string; @Column({ name:'SHOW_IN_DETAIL', type:'int', nullable:true }) public showInDetail:number; @Column({ name:'UNIT', type:'string', nullable:true, length:32 }) public unit:string; @Column({ name:'DEFAULT_VALUE', type:'string', nullable:true, length:512 }) public defaultValue:string; @Column({ name:'ENCRYPTION', type:'string', nullable:true, length:32 }) public encryption:string; @OneToMany({ entity:'AmOrgItem', mappedBy:'amProperty' }) public amOrgItems:Array; constructor(idValue?:number){ super(); this.propId = idValue; } public async getAmModel():Promise{ return this['amModel']?this['amModel']:await EntityProxy.get(this,'amModel'); } public async getAmOrgItems():Promise>{ return this['amOrgItems']?this['amOrgItems']:await EntityProxy.get(this,'amOrgItems'); } }