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.

26 lines (17 loc) 440 B
import { Entity, IEntity, OneToOne, PrimaryKey, Property } from '../../lib'; import { Book2 } from './Book2'; @Entity() export class Test2 { @PrimaryKey() id: number; @Property({ nullable: true }) name: string; @OneToOne({ cascade: [], inversedBy: 'test' }) book: Book2; static create(name: string) { const t = new Test2(); t.name = name; return t; } } export interface Test2 extends IEntity<number> { }