Пример #1
0
  static void onBatchLifeCycleEvent(MorphiaEvent event, MorphiaQuery query) {
    Class<? extends Model> c = query.getEntityClass();
    List<IMorphiaEventHandler> l = modelEventHandlers_.get(c);
    if (null != l) {
      for (IMorphiaEventHandler h : l) {
        event.invokeOn(h, query);
      }
    }

    for (IMorphiaEventHandler h : globalEventHandlers_) {
      event.invokeOn(h, query);
    }
  }
Пример #2
0
  static void onLifeCycleEvent(MorphiaEvent event, Model model) {
    Class<? extends Model> c = model.getClass();
    List<IMorphiaEventHandler> l = modelEventHandlers_.get(c);
    if (null != l) {
      for (IMorphiaEventHandler h : l) {
        event.invokeOn(h, model);
      }
    }

    for (IMorphiaEventHandler h : globalEventHandlers_) {
      event.invokeOn(h, model);
    }
  }