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.

28 lines (19 loc) 479 B
import { Entity, OneToOne, PrimaryKey, Property } from '../../lib'; import { BaseEntity22 } from './BaseEntity22'; import { FooBaz2 } from './FooBaz2'; @Entity() export class FooBar2 extends BaseEntity22 { @PrimaryKey() id: number; @Property() name: string; @OneToOne({ inversedBy: 'bar' }) baz: FooBaz2; @OneToOne({ owner: true }) fooBar: FooBar2; static create(name: string) { const bar = new FooBar2(); bar.name = name; return bar; } }