Exemplo n.º 1
0
  @Override
  protected boolean hasPostCommitEventListeners() {
    final EventListenerGroup<PostInsertEventListener> group =
        listenerGroup(EventType.POST_COMMIT_INSERT);
    for (PostInsertEventListener listener : group.listeners()) {
      if (listener.requiresPostCommitHanding(getPersister())) {
        return true;
      }
    }

    return false;
  }
Exemplo n.º 2
0
 private void postCommitInsert() {
   final EventListenerGroup<PostInsertEventListener> listenerGroup =
       listenerGroup(EventType.POST_COMMIT_INSERT);
   if (listenerGroup.isEmpty()) {
     return;
   }
   final PostInsertEvent event =
       new PostInsertEvent(getInstance(), getId(), getState(), getPersister(), eventSource());
   for (PostInsertEventListener listener : listenerGroup.listeners()) {
     listener.onPostInsert(event);
   }
 }