Class MapCollectionMapper<T extends Map>
java.lang.Object
org.hibernate.envers.internal.entities.mapper.AbstractMapper
org.hibernate.envers.internal.entities.mapper.AbstractPropertyMapper
org.hibernate.envers.internal.entities.mapper.relation.AbstractCollectionMapper<T>
org.hibernate.envers.internal.entities.mapper.relation.MapCollectionMapper<T>
- All Implemented Interfaces:
DynamicComponentMapperSupport
,ModifiedFlagMapperSupport
,PropertyMapper
- Direct Known Subclasses:
SortedMapCollectionMapper
public class MapCollectionMapper<T extends Map>
extends AbstractCollectionMapper<T>
implements PropertyMapper
-
Field Summary
Modifier and TypeFieldDescriptionprotected final MiddleComponentData
protected final MiddleComponentData
Fields inherited from class org.hibernate.envers.internal.entities.mapper.relation.AbstractCollectionMapper
collectionClass, commonCollectionMapperData, configuration, ordinalInId, revisionTypeInId
-
Constructor Summary
ConstructorDescriptionMapCollectionMapper
(Configuration configuration, CommonCollectionMapperData commonCollectionMapperData, Class<? extends T> collectionClass, Class<? extends T> proxyClass, MiddleComponentData elementComponentData, MiddleComponentData indexComponentData, boolean revisionTypeInId) -
Method Summary
Modifier and TypeMethodDescriptionbuildCollectionChangeSet
(Object eventCollection, Collection collection) protected Initializor<T>
getInitializor
(EnversService enversService, AuditReaderImplementor versionsReader, Object primaryKey, Number revision, boolean removed) protected Collection
getNewCollectionContent
(PersistentCollection newCollection) protected Collection
getOldCollectionContent
(Serializable oldCollection) protected boolean
isSame
(CollectionPersister collectionPersister, Object oldObject, Object newObject) Checks whether the old collection element and new collection element are the same.mapCollectionChanges
(SessionImplementor session, PersistentCollection newColl, Serializable oldColl, Object id) Map collection changes using hash identity.protected void
mapToMapFromObject
(SessionImplementor session, Map<String, Object> idData, Map<String, Object> data, Object changed) Maps the changed collection element to the given map.Methods inherited from class org.hibernate.envers.internal.entities.mapper.relation.AbstractCollectionMapper
addCollectionChanges, createIdMap, hasPropertiesWithModifiedFlag, mapCollectionChanges, mapModifiedFlagsToMapForCollectionChange, mapModifiedFlagsToMapFromEntity, mapToEntityFromMap, mapToEntityFromMap, mapToMapFromEntity, resolveCollectionPersister
Methods inherited from class org.hibernate.envers.internal.entities.mapper.AbstractPropertyMapper
isDynamicComponentMap, markAsDynamicComponentMap
Methods inherited from class org.hibernate.envers.internal.entities.mapper.AbstractMapper
doPrivileged, getAndSetValue, getValueFromObject, getValueFromObject, newObjectInstance, setValueOnObject
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.hibernate.envers.internal.entities.mapper.DynamicComponentMapperSupport
isDynamicComponentMap, markAsDynamicComponentMap
Methods inherited from interface org.hibernate.envers.internal.entities.mapper.ModifiedFlagMapperSupport
hasPropertiesWithModifiedFlag
Methods inherited from interface org.hibernate.envers.internal.entities.mapper.PropertyMapper
mapCollectionChanges, mapModifiedFlagsToMapForCollectionChange, mapModifiedFlagsToMapFromEntity, mapToEntityFromMap, mapToEntityFromMap, mapToMapFromEntity
-
Field Details
-
elementComponentData
-
indexComponentData
-
-
Constructor Details
-
MapCollectionMapper
public MapCollectionMapper(Configuration configuration, CommonCollectionMapperData commonCollectionMapperData, Class<? extends T> collectionClass, Class<? extends T> proxyClass, MiddleComponentData elementComponentData, MiddleComponentData indexComponentData, boolean revisionTypeInId)
-
-
Method Details
-
getInitializor
protected Initializor<T> getInitializor(EnversService enversService, AuditReaderImplementor versionsReader, Object primaryKey, Number revision, boolean removed) - Specified by:
getInitializor
in classAbstractCollectionMapper<T extends Map>
-
getNewCollectionContent
- Specified by:
getNewCollectionContent
in classAbstractCollectionMapper<T extends Map>
-
getOldCollectionContent
- Specified by:
getOldCollectionContent
in classAbstractCollectionMapper<T extends Map>
-
mapToMapFromObject
protected void mapToMapFromObject(SessionImplementor session, Map<String, Object> idData, Map<String, Object> data, Object changed) Description copied from class:AbstractCollectionMapper
Maps the changed collection element to the given map.- Specified by:
mapToMapFromObject
in classAbstractCollectionMapper<T extends Map>
idData
- Map to which composite-id data should be added.data
- Where to map the data.changed
- The changed collection element to map.
-
buildCollectionChangeSet
- Specified by:
buildCollectionChangeSet
in classAbstractCollectionMapper<T extends Map>
-
isSame
protected boolean isSame(CollectionPersister collectionPersister, Object oldObject, Object newObject) Description copied from class:AbstractCollectionMapper
Checks whether the old collection element and new collection element are the same. By default, this delegates to the collection persister'sCollectionPersister.getElementType()
.- Overrides:
isSame
in classAbstractCollectionMapper<T extends Map>
- Parameters:
collectionPersister
- The collection persister.oldObject
- The collection element from the old persistent collection.newObject
- The collection element from the new persistent collection.- Returns:
- true if the two objects are the same, false otherwise.
-
mapCollectionChanges
public List<PersistentCollectionChangeData> mapCollectionChanges(SessionImplementor session, PersistentCollection newColl, Serializable oldColl, Object id) Description copied from class:AbstractCollectionMapper
Map collection changes using hash identity.- Specified by:
mapCollectionChanges
in classAbstractCollectionMapper<T extends Map>
- Parameters:
session
- The session.newColl
- The new persistent collection.oldColl
- The old collection.id
- The owning entity identifier.- Returns:
- the persistent collection changes.
-