undeexcepturi
Version:
TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.
39 lines (28 loc) • 827 B
text/typescript
import { Cascade, Entity, ManyToMany, ManyToOne, Property } from '@mikro-orm/core';
import type { Publisher } from './Publisher';
import { Author } from './Author';
import type { BookTag } from './BookTag';
import { Collection, Ref } from '../TsMorphMetadataProvider.test';
import { BaseEntity3 } from './BaseEntity3';
()
export class Book extends BaseEntity3 {
()
title: string;
()
author: Author;
({ cascade: [Cascade.PERSIST, Cascade.REMOVE] })
publisher!: Ref<Publisher>;
()
tags = new Collection<BookTag>(this);
()
metaObject?: object;
()
metaArray?: any[];
()
metaArrayOfStrings?: string[];
constructor(title: string, author?: Author) {
super();
this.title = title;
this.author = author!;
}
}