created repository object to access entities

This commit is contained in:
azivner
2018-01-29 23:17:44 -05:00
parent 9a091408e3
commit 6fa6891496
12 changed files with 104 additions and 95 deletions

View File

@@ -1,8 +1,12 @@
"use strict";
const utils = require('../services/utils');
class Entity {
constructor(sql, row) {
this.sql = sql;
constructor(repository, row) {
utils.assertArguments(repository, row)
this.repository = repository;
for (const key in row) {
this[key] = row[key];