UNPKG

quaerateum

Version:

Simple 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 JS.

20 lines (14 loc) 419 B
import { Collection, Entity, ManyToMany, Property, QueryOrder } from '../../lib'; import { Book2 } from './Book2'; import { BaseEntity2 } from './BaseEntity2'; @Entity() export class BookTag2 extends BaseEntity2 { @Property({ length: 50 }) name: string; @ManyToMany({ entity: () => Book2, mappedBy: 'tags' }) books: Collection<Book2>; constructor(name: string) { super(); this.name = name; } }