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
(ServiceRegistry serviceRegistry, PropertyData propertyData) -
Method Summary
Modifier and TypeMethodDescriptionvoid
mapToEntityFromEntity
(Object objTo, Object objFrom) boolean
mapToEntityFromMap
(Object obj, Map data) void
mapToMapFromEntity
(Map<String, Object> data, Object obj) void
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
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 Details
-
VirtualEntitySingleIdMapper
-
-
Method Details
-
mapToMapFromId
-
mapToEntityFromEntity
- Overrides:
mapToEntityFromEntity
in classSingleIdMapper
-
mapToEntityFromMap
- 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
- Specified by:
mapToMapFromEntity
in interfaceIdMapper
- Overrides:
mapToMapFromEntity
in classSingleIdMapper
-