import { IPSOne2OneDataDEField } from './ipsone2-one-data-defield'; import { PSDEFieldImpl } from './psdefield-impl'; import { IPSDERBase } from '../der/ipsderbase'; export class PSOne2OneDataDEFieldImpl extends PSDEFieldImpl implements IPSOne2OneDataDEField { protected psder: IPSDERBase | null = null; getPSDER(): IPSDERBase | null { if (this.psder != null) return this.psder; const value = this.M.getPSDER; if (value == null) { return null; } this.psder = this.getPSModel4('dataentity.der.IPSDERBase', value, 'getPSDER') as IPSDERBase; return this.psder; } get psDER(): IPSDERBase | null { return this.getPSDER(); } getPSDERMust(): IPSDERBase { const value = this.getPSDER(); if (value == null) { throw new Error('未指定一对一关系'); } return value; } get cls(): string { return 'PSOne2OneDataDEFieldImpl'; } instanceof(cls: string): boolean { if (cls == 'dataentity.defield.IPSOne2OneDataDEField') return true; return super.instanceof(cls); } }