UNPKG

blow-data

Version:
25 lines (21 loc) 530 B
'use strict'; import {PersistedModel} from '../../src/PersistedModel'; import * as decorators from '../../src/decorators'; import {IHasManyRelation} from '../../src/interfaces'; import {Book} from './interfaces'; @decorators.model({ name: 'Author', connection: 'default' }) export class Author extends PersistedModel { @decorators.property({ type: 'String' }) name: string; @decorators.relation({ type: 'hasMany', model: 'Book', foreignKey: 'authorId' }) books: IHasManyRelation<Book>; }