Package org.hibernate.envers.internal.synchronization.work

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


  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

    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

      // 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

    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

    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

TOP

Related Classes of org.hibernate.envers.internal.synchronization.work.AuditWorkUnit

Copyright © 2018 www.massapicom. 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.