Package org.hibernate.envers.synchronization.work

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


    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

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

            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

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

            } 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

    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

        String entityName = event.getPersister().getEntityName();

        if ( getAuditConfiguration().getEntCfg().isVersioned( entityName ) ) {
            AuditProcess auditProcess = getAuditConfiguration().getSyncManager().get( event.getSession() );

            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).
            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,
          getAuditConfiguration(),
                    relatedId,
          relatedObj
View Full Code Here

        String entityName = event.getPersister().getEntityName();

        if ( getAuditConfiguration().getEntCfg().isVersioned( entityName ) ) {
            AuditProcess auditProcess = getAuditConfiguration().getSyncManager().get(event.getSession());

            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

TOP

Related Classes of org.hibernate.envers.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.