loopback-datasource-juggler/lib
Miroslav Bajtoš bec9142100 Implement operation hooks for EmbedsMany methods
create() triggers
 - before save
 - after save

updateById() triggers
 - before save
 - after save

destroy() triggers
 - before delete
 - after delete

The implementation here is intentionally left with less features
than the regular DAO methods provide, the goal is to get a partial
(but still useful!) version released soon.

Limitations:

 - `before save` & `after save` hooks don't provide `ctx.isNewInstance`
 - async validations are not supported yet
 - `persist` and `loaded` hooks are not triggered at all

 - `before delete` hook does not provide `ctx.where` property and
    it's not possible to change the outcome of `destroy()` using this
    hook. Note that regular DAO does support this.

 - updating embedded instances triggers update of the parent (owning)
   model, which is correct and expected. However, the context provided
   by `before save` and `after save` hooks on the parent model is sort of
   arbitrary and may include wrong/extra data. The same probably applies
   to the scenario when deleting embedded instances triggers update of
   the parent model.

[back-port of #911]
2016-04-28 10:15:14 +02:00
..
connectors eslint config 2.0 + remove extra empty lines 2016-04-19 17:06:04 +02:00
browser.depd.js Insert copyright headers 2016-04-06 16:51:49 +02:00
dao.js eslint config 2.0 + remove extra empty lines 2016-04-19 17:06:04 +02:00
datasource.js Run `eslint --fix` with config from master 2016-04-18 16:00:04 +02:00
geo.js Run `eslint --fix` with config from master 2016-04-18 16:00:04 +02:00
hooks.js Run `eslint --fix` with config from master 2016-04-18 16:00:04 +02:00
include.js eslint config 2.0 + remove extra empty lines 2016-04-19 17:06:04 +02:00
include_utils.js eslint config 2.0 + remove extra empty lines 2016-04-19 17:06:04 +02:00
introspection.js eslint config 2.0 + remove extra empty lines 2016-04-19 17:06:04 +02:00
jutil.js Run `eslint --fix` with config from master 2016-04-18 16:00:04 +02:00
list.js Run `eslint --fix` with config from master 2016-04-18 16:00:04 +02:00
mixins.js Run `eslint --fix` with config from master 2016-04-18 16:00:04 +02:00
model-builder.js Run `eslint --fix` with config from master 2016-04-18 16:00:04 +02:00
model-definition.js Run `eslint --fix` with config from master 2016-04-18 16:00:04 +02:00
model.js Run `eslint --fix` with config from master 2016-04-18 16:00:04 +02:00
observer.js Run `eslint --fix` with config from master 2016-04-18 16:00:04 +02:00
relation-definition.js Implement operation hooks for EmbedsMany methods 2016-04-28 10:15:14 +02:00
relations.js Run `eslint --fix` with config from master 2016-04-18 16:00:04 +02:00
scope.js Run `eslint --fix` with config from master 2016-04-18 16:00:04 +02:00
transaction.js eslint config 2.0 + remove extra empty lines 2016-04-19 17:06:04 +02:00
types.js Run `eslint --fix` with config from master 2016-04-18 16:00:04 +02:00
utils.js Run `eslint --fix` with config from master 2016-04-18 16:00:04 +02:00
validations.js Run `eslint --fix` with config from master 2016-04-18 16:00:04 +02:00