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 theSingleIdMapper
implementation that supports the use case of an@IdClass
mapping that contains an entity association where the@IdClass
stores 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 void
mapToEntityFromEntity(Object objTo, Object objFrom)
boolean
mapToEntityFromMap(Object obj, Map data)
void
mapToMapFromEntity(Map<String,Object> data, Object obj)
void
mapToMapFromId(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:
mapToEntityFromEntity
in classSingleIdMapper
-
mapToEntityFromMap
public boolean mapToEntityFromMap(Object obj, Map data)
- Specified by:
mapToEntityFromMap
in interfaceIdMapper
- Overrides:
mapToEntityFromMap
in 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:
mapToMapFromEntity
in interfaceIdMapper
- Overrides:
mapToMapFromEntity
in classSingleIdMapper
-
-