Examples of AuditWorkUnit


Examples of org.hibernate.envers.internal.synchronization.work.AuditWorkUnit

      else {
        final String entityName = vwu.getEntityName();
        final Pair<String, Object> usedIdsKey = Pair.make( entityName, entityId );

        if ( usedIds.containsKey( usedIdsKey ) ) {
          final AuditWorkUnit other = usedIds.get( usedIdsKey );
          final AuditWorkUnit result = vwu.dispatch( other );

          if ( result != other ) {
            removeWorkUnit( other );

            if ( result != null ) {
View Full Code Here

Examples of org.hibernate.envers.internal.synchronization.work.AuditWorkUnit

  private void executeInSession(Session session) {
    // Making sure the revision data is persisted.
    final Object currentRevisionData = getCurrentRevisionData( session, true );

    AuditWorkUnit vwu;

    // First undoing any performed work units
    while ( (vwu = undoQueue.poll()) != null ) {
      vwu.undo( session );
    }

    while ( (vwu = workUnits.poll()) != null ) {
      vwu.perform( session, revisionData );
      entityChangeNotifier.entityChanged( session, currentRevisionData, vwu );
    }
  }
View Full Code Here

Examples of org.hibernate.envers.internal.synchronization.work.AuditWorkUnit

    if ( getAuditConfiguration().getEntCfg().isVersioned( entityName ) ) {
      checkIfTransactionInProgress( event.getSession() );

      final AuditProcess auditProcess = getAuditConfiguration().getSyncManager().get( event.getSession() );

      final AuditWorkUnit workUnit = new DelWorkUnit(
          event.getSession(),
          event.getPersister().getEntityName(),
          getAuditConfiguration(),
          event.getId(),
          event.getPersister(),
          event.getDeletedState()
      );
      auditProcess.addWorkUnit( workUnit );

      if ( workUnit.containsWork() ) {
        generateBidirectionalCollectionChangeWorkUnits(
            auditProcess,
            event.getPersister(),
            entityName,
            null,
View Full Code Here

Examples of org.hibernate.envers.internal.synchronization.work.AuditWorkUnit

      // This can be different from relatedEntityName, in case of inheritance (the real entity may be a subclass
      // of relatedEntityName).
      final String realRelatedEntityName = event.getSession().bestGuessEntityName( relatedObj );

      // By default, the nested work unit is a collection change work unit.
      final AuditWorkUnit nestedWorkUnit = new CollectionChangeWorkUnit(
          event.getSession(),
          realRelatedEntityName,
          rd.getMappedByPropertyName(),
          getAuditConfiguration(),
          relatedId,
View Full Code Here

Examples of org.hibernate.envers.internal.synchronization.work.AuditWorkUnit

    if ( getAuditConfiguration().getEntCfg().isVersioned( entityName ) ) {
      checkIfTransactionInProgress( event.getSession() );

      final AuditProcess auditProcess = getAuditConfiguration().getSyncManager().get( event.getSession() );

      final AuditWorkUnit workUnit = new AddWorkUnit(
          event.getSession(),
          event.getPersister().getEntityName(),
          getAuditConfiguration(),
          event.getId(),
          event.getPersister(),
          event.getState()
      );
      auditProcess.addWorkUnit( workUnit );

      if ( workUnit.containsWork() ) {
        generateBidirectionalCollectionChangeWorkUnits(
            auditProcess,
            event.getPersister(),
            entityName,
            event.getState(),
View Full Code Here

Examples of org.hibernate.envers.internal.synchronization.work.AuditWorkUnit

    if ( getAuditConfiguration().getEntCfg().isVersioned( entityName ) ) {
      checkIfTransactionInProgress( event.getSession() );

      final AuditProcess auditProcess = getAuditConfiguration().getSyncManager().get( event.getSession() );
      final Object[] newDbState = postUpdateDBState( event );
      final AuditWorkUnit workUnit = new ModWorkUnit(
          event.getSession(),
          event.getPersister().getEntityName(),
          getAuditConfiguration(),
          event.getId(),
          event.getPersister(),
          newDbState,
          event.getOldState()
      );
      auditProcess.addWorkUnit( workUnit );

      if ( workUnit.containsWork() ) {
        generateBidirectionalCollectionChangeWorkUnits(
            auditProcess,
            event.getPersister(),
            entityName,
            newDbState,
View Full Code Here

Examples of org.hibernate.envers.synchronization.work.AuditWorkUnit

            } else {
                String entityName = vwu.getEntityName();
                Pair<String, Object> usedIdsKey = Pair.make(entityName, entityId);

                if (usedIds.containsKey(usedIdsKey)) {
                    AuditWorkUnit other = usedIds.get(usedIdsKey);

                    AuditWorkUnit result = vwu.dispatch(other);

                    if (result != other) {
                        removeWorkUnit(other);

                        if (result != null) {
View Full Code Here

Examples of org.hibernate.envers.synchronization.work.AuditWorkUnit

    private void executeInSession(Session session) {
    // Making sure the revision data is persisted.
        getCurrentRevisionData(session, true);

        AuditWorkUnit vwu;

        // First undoing any performed work units
        while ((vwu = undoQueue.poll()) != null) {
            vwu.undo(session);
        }

        while ((vwu = workUnits.poll()) != null) {
            vwu.perform(session, revisionData);
        }
    }
View Full Code Here

Examples of org.hibernate.envers.synchronization.work.AuditWorkUnit

            // This can be different from relatedEntityName, in case of inheritance (the real entity may be a subclass
            // of relatedEntityName).
            String realRelatedEntityName = event.getSession().bestGuessEntityName(relatedObj);

            // By default, the nested work unit is a collection change work unit.
            AuditWorkUnit nestedWorkUnit = new CollectionChangeWorkUnit(
          event.getSession(),
          realRelatedEntityName,
          rd.getMappedByPropertyName(),
          getAuditConfiguration(),
                    relatedId,
View Full Code Here

Examples of org.hibernate.envers.synchronization.work.AuditWorkUnit

            AuditProcess auditProcess = getAuditConfiguration().getSyncManager().get(event.getSession());

      final Object[] newDbState = postUpdateDBState( event );

            AuditWorkUnit workUnit = new ModWorkUnit(
          event.getSession(),
          event.getPersister().getEntityName(),
          getAuditConfiguration(),
                    event.getId(),
          event.getPersister(),
          newDbState,
          event.getOldState()
      );
            auditProcess.addWorkUnit( workUnit );

            if ( workUnit.containsWork() ) {
                generateBidirectionalCollectionChangeWorkUnits(
            auditProcess,
            event.getPersister(),
            entityName,
            newDbState,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.