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

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


        toEntityName
    );
    final String toPropertyName = toPropertyNames.iterator().next();

    auditProcess.addWorkUnit(
        new CollectionChangeWorkUnit(
            session, toEntityName,
            toPropertyName, enversConfiguration, id, value
        )
    );
  }
View Full Code Here


        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(),
                  event.getAffectedOwnerIdOrNull(),
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,
          relatedObj
      );

      auditProcess.addWorkUnit(
          new FakeBidirectionalRelationWorkUnit(
              event.getSession(),
              realRelatedEntityName,
              getAuditConfiguration(),
              relatedId,
              referencingPropertyName,
              event.getAffectedOwnerOrNull(),
              rd,
              revType,
              changeData.getChangedElementIndex(),
              nestedWorkUnit
          )
      );
    }

    // We also have to generate a collection change work unit for the owning entity.
    auditProcess.addWorkUnit(
        new CollectionChangeWorkUnit(
            event.getSession(),
            collectionEntityName,
            referencingPropertyName,
            getAuditConfiguration(),
            event.getAffectedOwnerIdOrNull(),
View Full Code Here

      for ( PersistentCollectionChangeData changeData : workUnit.getCollectionChanges() ) {
        final Object relatedObj = changeData.getChangedElement();
        final Serializable relatedId = (Serializable) relatedIdMapper.mapToIdFromEntity( relatedObj );

        auditProcess.addWorkUnit(
            new CollectionChangeWorkUnit(
                event.getSession(),
                event.getSession().bestGuessEntityName( relatedObj ),
                toPropertyName,
                getAuditConfiguration(),
                relatedId,
View Full Code Here

TOP

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

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.