public class MapCollectionMapper<T extends Map> extends AbstractCollectionMapper<T> implements PropertyMapper
Modifier and Type | Field and Description |
---|---|
protected MiddleComponentData |
elementComponentData |
protected MiddleComponentData |
indexComponentData |
collectionClass, commonCollectionMapperData, ordinalInId, revisionTypeInId
Constructor and Description |
---|
MapCollectionMapper(CommonCollectionMapperData commonCollectionMapperData,
Class<? extends T> collectionClass,
Class<? extends T> proxyClass,
MiddleComponentData elementComponentData,
MiddleComponentData indexComponentData,
boolean revisionTypeInId) |
Modifier and Type | Method and Description |
---|---|
protected Set<Object> |
buildCollectionChangeSet(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.
|
List<PersistentCollectionChangeData> |
mapCollectionChanges(SessionImplementor session,
PersistentCollection newColl,
Serializable oldColl,
Serializable 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.
|
addCollectionChanges, createIdMap, hasPropertiesWithModifiedFlag, mapCollectionChanges, mapModifiedFlagsToMapForCollectionChange, mapModifiedFlagsToMapFromEntity, mapToEntityFromMap, mapToMapFromEntity, resolveCollectionPersister
isDynamicComponentMap, markAsDynamicComponentMap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
mapCollectionChanges, mapModifiedFlagsToMapForCollectionChange, mapModifiedFlagsToMapFromEntity, mapToEntityFromMap, mapToMapFromEntity
hasPropertiesWithModifiedFlag
isDynamicComponentMap, markAsDynamicComponentMap
protected final MiddleComponentData elementComponentData
protected final MiddleComponentData indexComponentData
public MapCollectionMapper(CommonCollectionMapperData commonCollectionMapperData, Class<? extends T> collectionClass, Class<? extends T> proxyClass, MiddleComponentData elementComponentData, MiddleComponentData indexComponentData, boolean revisionTypeInId)
protected Initializor<T> getInitializor(EnversService enversService, AuditReaderImplementor versionsReader, Object primaryKey, Number revision, boolean removed)
getInitializor
in class AbstractCollectionMapper<T extends Map>
protected Collection getNewCollectionContent(PersistentCollection newCollection)
getNewCollectionContent
in class AbstractCollectionMapper<T extends Map>
protected Collection getOldCollectionContent(Serializable oldCollection)
getOldCollectionContent
in class AbstractCollectionMapper<T extends Map>
protected void mapToMapFromObject(SessionImplementor session, Map<String,Object> idData, Map<String,Object> data, Object changed)
AbstractCollectionMapper
mapToMapFromObject
in class AbstractCollectionMapper<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.protected Set<Object> buildCollectionChangeSet(Object eventCollection, Collection collection)
buildCollectionChangeSet
in class AbstractCollectionMapper<T extends Map>
protected boolean isSame(CollectionPersister collectionPersister, Object oldObject, Object newObject)
AbstractCollectionMapper
CollectionPersister.getElementType()
.isSame
in class AbstractCollectionMapper<T extends Map>
collectionPersister
- The collection persister.oldObject
- The collection element from the old persistent collection.newObject
- The collection element from the new persistent collection.public List<PersistentCollectionChangeData> mapCollectionChanges(SessionImplementor session, PersistentCollection newColl, Serializable oldColl, Serializable id)
AbstractCollectionMapper
mapCollectionChanges
in class AbstractCollectionMapper<T extends Map>
session
- The session.newColl
- The new persistent collection.oldColl
- The old collection.id
- The owning entity identifier.Copyright © 2019 JBoss by Red Hat. All rights reserved.