Examples of AuditProcess


Examples of org.hibernate.envers.internal.synchronization.AuditProcess

    if ( !(session instanceof EventSource) ) {
      throw new IllegalArgumentException( "The provided session is not an EventSource!" );
    }

    // Obtaining the current audit sync
    final AuditProcess auditProcess = verCfg.getSyncManager().get( (EventSource) session );

    // And getting the current revision data
    return (T) auditProcess.getCurrentRevisionData( session, persist );
  }
View Full Code Here

Examples of org.hibernate.envers.internal.synchronization.AuditProcess

    if ( !(session instanceof EventSource) ) {
      throw new IllegalArgumentException( "The provided session is not an EventSource!" );
    }

    // Obtaining the current audit sync
    final AuditProcess auditProcess = verCfg.getSyncManager().get( (EventSource) session );

    // And getting the current revision data
    return (T) auditProcess.getCurrentRevisionData( session, persist );
  }
View Full Code Here

Examples of org.hibernate.envers.internal.synchronization.AuditProcess

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

    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(),
View Full Code Here

Examples of org.hibernate.envers.internal.synchronization.AuditProcess

      Serializable oldColl,
      CollectionEntry collectionEntry) {
    if ( shouldGenerateRevision( event ) ) {
      checkIfTransactionInProgress( event.getSession() );

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

      final String entityName = event.getAffectedOwnerEntityName();
      final String ownerEntityName = ((AbstractCollectionPersister) collectionEntry.getLoadedPersister()).getOwnerEntityName();
      final String referencingPropertyName = collectionEntry.getRole().substring( ownerEntityName.length() + 1 );

      // Checking if this is not a "fake" many-to-one bidirectional relation. The relation description may be
      // null in case of collections of non-entities.
      final RelationDescription rd = searchForRelationDescription( entityName, referencingPropertyName );
      if ( rd != null && rd.getMappedByPropertyName() != null ) {
        generateFakeBidirecationalRelationWorkUnits(
            auditProcess,
            newColl,
            oldColl,
            entityName,
            referencingPropertyName,
            event,
            rd
        );
      }
      else {
        final PersistentCollectionChangeWorkUnit workUnit = new PersistentCollectionChangeWorkUnit(
            event.getSession(),
            entityName,
            getAuditConfiguration(),
            newColl,
            collectionEntry,
            oldColl,
            event.getAffectedOwnerIdOrNull(),
            referencingPropertyName
        );
        auditProcess.addWorkUnit( workUnit );

        if ( workUnit.containsWork() ) {
          // There are some changes: a revision needs also be generated for the collection owner
          auditProcess.addWorkUnit(
              new CollectionChangeWorkUnit(
                  event.getSession(),
                  event.getAffectedOwnerEntityName(),
                  referencingPropertyName,
                  getAuditConfiguration(),
View Full Code Here

Examples of org.hibernate.envers.internal.synchronization.AuditProcess

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

    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(),
View Full Code Here

Examples of org.hibernate.envers.internal.synchronization.AuditProcess

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

    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(),
View Full Code Here

Examples of org.hibernate.envers.synchronization.AuditProcess

    if (!(session instanceof EventSource)) {
      throw new IllegalArgumentException("The provided session is not an EventSource!");
    }

    // Obtaining the current audit sync
    AuditProcess auditProcess = verCfg.getSyncManager().get((EventSource) session);

    // And getting the current revision data
    return (T) auditProcess.getCurrentRevisionData(session, persist);
  }
View Full Code Here

Examples of org.hibernate.envers.synchronization.AuditProcess

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

            String ownerEntityName = ((AbstractCollectionPersister) collectionEntry.getLoadedPersister()).getOwnerEntityName();
            String referencingPropertyName = collectionEntry.getRole().substring(ownerEntityName.length() + 1);

            // Checking if this is not a "fake" many-to-one bidirectional relation. The relation description may be
            // null in case of collections of non-entities.
            RelationDescription rd = searchForRelationDescription( entityName, referencingPropertyName );
            if ( rd != null && rd.getMappedByPropertyName() != null ) {
                generateFakeBidirecationalRelationWorkUnits(
            auditProcess,
            newColl,
            oldColl,
            entityName,
                        referencingPropertyName,
            event,
            rd
        );
            }
      else {
                PersistentCollectionChangeWorkUnit workUnit = new PersistentCollectionChangeWorkUnit(
            event.getSession(),
            entityName,
            getAuditConfiguration(),
            newColl,
            collectionEntry,
            oldColl,
            event.getAffectedOwnerIdOrNull(),
            referencingPropertyName
        );
        auditProcess.addWorkUnit( workUnit );

                if (workUnit.containsWork()) {
                    // There are some changes: a revision needs also be generated for the collection owner
                    auditProcess.addWorkUnit(
              new CollectionChangeWorkUnit(
                  event.getSession(),
                  event.getAffectedOwnerEntityName(),
                  referencingPropertyName,
                  getAuditConfiguration(),
View Full Code Here

Examples of org.hibernate.envers.synchronization.AuditProcess

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

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

            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(),
View Full Code Here

Examples of org.hibernate.envers.synchronization.AuditProcess

    public void onPostInsert(PostInsertEvent event) {
        String entityName = event.getPersister().getEntityName();

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

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

            if (workUnit.containsWork()) {
                generateBidirectionalCollectionChangeWorkUnits(auditProcess, event.getPersister(), entityName, event.getState(),
                        null, event.getSession());
            }
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.