phibernate
Version:
Client side ORM and Delta Tracker for Relational data
30 lines (25 loc) • 836 B
text/typescript
import {EntityChange} from "./EntityChange";
import {Column, JoinColumn, ManyToOne, MappedSuperclass} from "querydsl-typescript";
import {DeltaRecord} from "./DeltaRecord";
/**
* Created by Papa on 9/15/2016.
*/
()
export abstract class AbstractFieldChange extends DeltaRecord {
({name: "ENTITY_RELATION_NAME"})
entityRelationName: string;
({name: "PROPERTY_NAME"})
propertyName: string;
()
({name: "ENTITY_CHANGE_ID", nullable: false})
entityChange: EntityChange;
static getFieldChangeId(
propertyName: string,
entityIdInGroup: number,
createDeviceId: string,
createDateTime: Date,
createUserId: string
): string {
return `${entityIdInGroup}_${createDeviceId}_${createDateTime.getTime()}_${createUserId}_${propertyName}`;
}
}