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
An extension to the
SingleIdMapper 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
ConstructorsConstructorDescriptionVirtualEntitySingleIdMapper(org.hibernate.service.ServiceRegistry serviceRegistry, PropertyData propertyData) -
Method Summary
Modifier and TypeMethodDescriptionvoidmapToEntityFromEntity(Object objTo, Object objFrom) booleanmapToEntityFromMap(Object obj, Map data) voidmapToMapFromEntity(Map<String, Object> data, Object obj) voidmapToMapFromId(org.hibernate.engine.spi.SharedSessionContractImplementor session, Map<String, Object> data, Object obj) Methods inherited from class SingleIdMapper
add, add, mapToIdFromEntity, mapToIdFromMap, mapToMapFromId, mapToQueryParametersFromId, prefixMappedPropertiesMethods inherited from class AbstractIdMapper
addIdEqualsToQuery, addIdsEqualToQuery, addIdsEqualToQuery, addNamedIdEqualsToQuery, addNamedIdEqualsToQuery, addNullableIdsEqualToQuery, getAndSetValue, getServiceRegistry, getValueFromObject, setValueOnObjectMethods inherited from class AbstractMapper
getAndSetValue, getValueFromObject, getValueFromObject, newObjectInstance, setValueOnObjectMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IdMapper
addIdEqualsToQuery, addIdsEqualToQuery, addIdsEqualToQuery, addNamedIdEqualsToQuery, addNamedIdEqualsToQuery, addNullableIdsEqualToQuery, getServiceRegistry
-
Constructor Details
-
VirtualEntitySingleIdMapper
public VirtualEntitySingleIdMapper(org.hibernate.service.ServiceRegistry serviceRegistry, PropertyData propertyData)
-
-
Method Details
-
mapToEntityFromEntity
- Overrides:
mapToEntityFromEntityin classSingleIdMapper
-
mapToEntityFromMap
- 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
- Specified by:
mapToMapFromEntityin interfaceIdMapper- Overrides:
mapToMapFromEntityin classSingleIdMapper