Package org.hibernate.envers.internal.entities

Examples of org.hibernate.envers.internal.entities.PropertyData


      element.setParent( null );
      parent.add( element );
    }

    // Adding mapper for the id
    final PropertyData propertyData = propertyAuditingData.getPropertyData();
    mapper.addComposite(
        propertyData,
        new ToOneIdMapper( relMapper, propertyData, referencedEntityName, nonInsertableFake )
    );
  }
View Full Code Here


        referencedEntityName,
        ownedIdMapper
    );

    // Adding mapper for the id
    final PropertyData propertyData = propertyAuditingData.getPropertyData();
    mapper.addComposite(
        propertyData,
        new OneToOneNotOwningMapper( entityName, referencedEntityName, owningReferencePropertyName, propertyData )
    );
  }
View Full Code Here

        relMapper,
        insertable
    );

    // Adding mapper for the id
    final PropertyData propertyData = propertyAuditingData.getPropertyData();
    mapper.addComposite(
        propertyData,
        new OneToOnePrimaryKeyJoinColumnMapper( entityName, referencedEntityName, propertyData )
    );
  }
View Full Code Here

  public IdMapper prefixMappedProperties(String prefix) {
    final EmbeddedIdMapper ret = new EmbeddedIdMapper( idPropertyData, compositeIdClass );

    for ( PropertyData propertyData : ids.keySet() ) {
      final String propertyName = propertyData.getName();
      ret.ids.put( propertyData, new SingleIdMapper( new PropertyData( prefix + propertyName, propertyData ) ) );
    }

    return ret;
  }
View Full Code Here

  public void mapModifiedFlagsToMapFromEntity(
      SessionImplementor session,
      Map<String, Object> data,
      Object newObj,
      Object oldObj) {
    final PropertyData propertyData = commonCollectionMapperData.getCollectionReferencingPropertyData();
    if ( propertyData.isUsingModifiedFlag() ) {
      if ( isNotPersistentCollection( newObj ) || isNotPersistentCollection( oldObj ) ) {
        // Compare POJOs.
        data.put( propertyData.getModifiedFlagPropertyName(), !Tools.objectsEqual( newObj, oldObj ) );
      }
      else if ( isFromNullToEmptyOrFromEmptyToNull( (PersistentCollection) newObj, (Serializable) oldObj ) ) {
        data.put( propertyData.getModifiedFlagPropertyName(), true );
      }
      else {
        final List<PersistentCollectionChangeData> changes = mapCollectionChanges(
            session,
            commonCollectionMapperData.getCollectionReferencingPropertyData().getName(),
            (PersistentCollection) newObj,
            (Serializable) oldObj,
            null
        );
        data.put( propertyData.getModifiedFlagPropertyName(), !changes.isEmpty() );
      }
    }
  }
View Full Code Here

        || newCollection == null && oldCollection != null && oldCollection.isEmpty();
  }

  @Override
  public void mapModifiedFlagsToMapForCollectionChange(String collectionPropertyName, Map<String, Object> data) {
    final PropertyData propertyData = commonCollectionMapperData.getCollectionReferencingPropertyData();
    if ( propertyData.isUsingModifiedFlag() ) {
      data.put(
          propertyData.getModifiedFlagPropertyName(),
          propertyData.getName().equals( collectionPropertyName )
      );
    }
  }
View Full Code Here

  public IdMapper prefixMappedProperties(String prefix) {
    final MultipleIdMapper ret = new MultipleIdMapper( compositeIdClass );

    for ( PropertyData propertyData : ids.keySet() ) {
      final String propertyName = propertyData.getName();
      ret.ids.put( propertyData, new SingleIdMapper( new PropertyData( prefix + propertyName, propertyData ) ) );
    }

    return ret;
  }
View Full Code Here

    setter.set( objTo, getter.get( objFrom ), null );
  }

  @Override
  public IdMapper prefixMappedProperties(String prefix) {
    return new SingleIdMapper( new PropertyData( prefix + propertyData.getName(), propertyData ) );
  }
View Full Code Here

      element.setParent( null );
      parent.add( element );
    }

    // Adding mapper for the id
    final PropertyData propertyData = propertyAuditingData.getPropertyData();
    mapper.addComposite(
        propertyData,
        new ToOneIdMapper( relMapper, propertyData, referencedEntityName, nonInsertableFake )
    );
  }
View Full Code Here

        propertyAuditingData.getName(), owningReferencePropertyName, referencedEntityName,
        ownedIdMapper, MappingTools.ignoreNotFound( value )
    );

    // Adding mapper for the id
    final PropertyData propertyData = propertyAuditingData.getPropertyData();
    mapper.addComposite(
        propertyData,
        new OneToOneNotOwningMapper( entityName, referencedEntityName, owningReferencePropertyName, propertyData )
    );
  }
View Full Code Here

TOP

Related Classes of org.hibernate.envers.internal.entities.PropertyData

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.