Class VirtualEntitySingleIdMapper
- java.lang.Object
-
- org.hibernate.envers.internal.entities.mapper.AbstractMapper
-
- org.hibernate.envers.internal.entities.mapper.id.AbstractIdMapper
-
- org.hibernate.envers.internal.entities.mapper.id.SingleIdMapper
-
- org.hibernate.envers.internal.entities.mapper.id.VirtualEntitySingleIdMapper
-
- All Implemented Interfaces:
IdMapper,SimpleIdMapperBuilder,SimpleMapperBuilder
public class VirtualEntitySingleIdMapper extends SingleIdMapper
An extension to theSingleIdMapperimplementation that supports the use case of an@IdClassmapping that contains an entity association where the@IdClassstores the primary key of the associated entity rather than the entity object itself.Internally this mapper is capable of transforming the primary key values into the associated entity object and vice versa depending upon the operation.
-
-
Constructor Summary
Constructors Constructor Description VirtualEntitySingleIdMapper(ServiceRegistry serviceRegistry, PropertyData propertyData)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidmapToEntityFromEntity(Object objTo, Object objFrom)booleanmapToEntityFromMap(Object obj, Map data)voidmapToMapFromEntity(Map<String,Object> data, Object obj)voidmapToMapFromId(Session session, Map<String,Object> data, Object obj)-
Methods inherited from class org.hibernate.envers.internal.entities.mapper.id.SingleIdMapper
add, add, mapToIdFromEntity, mapToIdFromMap, mapToMapFromId, mapToQueryParametersFromId, prefixMappedProperties
-
Methods inherited from class org.hibernate.envers.internal.entities.mapper.id.AbstractIdMapper
addIdEqualsToQuery, addIdsEqualToQuery, addIdsEqualToQuery, addNamedIdEqualsToQuery, addNamedIdEqualsToQuery, addNullableIdsEqualToQuery, getAndSetValue, getServiceRegistry, getValueFromObject, setValueOnObject
-
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.id.IdMapper
addIdEqualsToQuery, addIdsEqualToQuery, addIdsEqualToQuery, addNamedIdEqualsToQuery, addNamedIdEqualsToQuery, addNullableIdsEqualToQuery, getServiceRegistry
-
-
-
-
Constructor Detail
-
VirtualEntitySingleIdMapper
public VirtualEntitySingleIdMapper(ServiceRegistry serviceRegistry, PropertyData propertyData)
-
-
Method Detail
-
mapToEntityFromEntity
public void mapToEntityFromEntity(Object objTo, Object objFrom)
- Overrides:
mapToEntityFromEntityin classSingleIdMapper
-
mapToEntityFromMap
public boolean mapToEntityFromMap(Object obj, Map data)
- Specified by:
mapToEntityFromMapin interfaceIdMapper- Overrides:
mapToEntityFromMapin classSingleIdMapper- Parameters:
obj- Object to map to.data- Data to map.- Returns:
- True if data was mapped; false otherwise (when the id is
null).
-
mapToMapFromEntity
public void mapToMapFromEntity(Map<String,Object> data, Object obj)
- Specified by:
mapToMapFromEntityin interfaceIdMapper- Overrides:
mapToMapFromEntityin classSingleIdMapper
-
-