Package org.hibernate.envers.internal.synchronization

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


    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

    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

      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

    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

    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

TOP

Related Classes of org.hibernate.envers.internal.synchronization.AuditProcess

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.