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.
43 lines (37 loc) • 786 B
JavaScript
const { Collection, EntitySchema } = require('@mikro-orm/core');
const { BaseEntity4 } = require('./index').BaseEntity4;
/**
* @property {number} id
* @property {string} name
* @property {Collection<Book3>} books
*/
class BookTag3 extends BaseEntity4 {
/**
* @param {string} name
*/
constructor(name) {
super();
this.name = name;
}
}
const schema = new EntitySchema({
class: BookTag3,
extends: 'BaseEntity4',
properties: {
name: { type: 'string' },
books: {
kind: 'm:n',
owner: false,
mappedBy: 'tags',
type: 'Book3',
},
version: {
version: true,
type: 'Date',
},
},
path: __filename,
});
module.exports.BookTag3 = BookTag3;
module.exports.entity = BookTag3;
module.exports.schema = schema;