Audit Model All four features are activated using classifier modifiers. Most classifier modifiers are compiler macros that are shorthand for a longer syntax that you could write out if desired. systemTemporal The modifier is shorthand for adding three properties. and become part of the data layer. is a synthetic property used in queries and criteria. Relationships between two classes also implicitly include an equality clause between their properties. versioned The modifier is shorthand for adding a new version class and an association to it. audited Auditing means keeping track of who made which modifications. To use auditing, there must be a class. There may only be a single class in the model. The modifier is shorthand for adding three properties and two parameterized properties. If the class is , the version class gets the same properties. class Question systemTemporal versioned audited { // ... } systemTemporal class Question { // ... system: TemporalRange system; systemFrom: TemporalInstant system from; systemTo: TemporalInstant system to; } systemFrom systemTo system systemTemporal system association QuestionHasAnswer { question: Question[1..1] final; answers: Answer[0..*]; relationship (this.id == Answer.questionId) && this.system == Answer.system // The additional clause } versioned class QuestionVersion systemTemporal { id: Long key; // version modifier indicates the property holding the version number number: Integer version; } association QuestionHasVersion { question: Question[1..1]; version: QuestionVersion[1..1] owned version; relationship this.id == QuestionVersion.id } user user // keyword `user` instead of `class` user User systemTemporal { // user class must have a single String key userId userId: String key userId; // All other properties must be optional firstName: String?; lastName: String?; email: String?; } audited versioned class Question systemTemporal { // ... createdById: String private createdBy; createdOn: Instant createdOn; lastUpdatedById: String private lastUpdatedBy; // A parameterized-property. Gives the User instead of the userId createdBy(): User[1..1] createdBy { this.createdById == User.userId } lastUpdatedBy(): User[1..1] lastUpdatedBy { this.lastUpdatedById == User.userId } } class QuestionVersion systemTemporal { id: Long key; number: Integer version; createdById: String private createdBy; createdOn: Instant createdOn; lastUpdatedById: String private lastUpdatedBy; createdBy(): User[1..1] createdBy { this.createdById == User.userId } lastUpdatedBy(): User[1..1] lastUpdatedBy { this.lastUpdatedById == User.userId } }