Class SingleIdMapper
- 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
-
- All Implemented Interfaces:
IdMapper,SimpleIdMapperBuilder,SimpleMapperBuilder
- Direct Known Subclasses:
VirtualEntitySingleIdMapper
public class SingleIdMapper extends AbstractIdMapper implements SimpleIdMapperBuilder
An implementation of an identifier mapper for a single basic attribute property.
-
-
Constructor Summary
Constructors Constructor Description SingleIdMapper(ServiceRegistry serviceRegistry)SingleIdMapper(ServiceRegistry serviceRegistry, PropertyData propertyData)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(PropertyData propertyData)voidadd(PropertyData propertyData, AbstractIdMapper idMapper)Add a custom identifier mapper to the builder.voidmapToEntityFromEntity(Object objTo, Object objFrom)booleanmapToEntityFromMap(Object obj, Map data)ObjectmapToIdFromEntity(Object data)ObjectmapToIdFromMap(Map data)voidmapToMapFromEntity(Map<String,Object> data, Object obj)voidmapToMapFromId(Map<String,Object> data, Object obj)List<QueryParameterData>mapToQueryParametersFromId(Object obj)IdMapperprefixMappedProperties(String prefix)Creates a mapper with all mapped properties prefixed.-
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, mapToMapFromId
-
-
-
-
Constructor Detail
-
SingleIdMapper
public SingleIdMapper(ServiceRegistry serviceRegistry)
-
SingleIdMapper
public SingleIdMapper(ServiceRegistry serviceRegistry, PropertyData propertyData)
-
-
Method Detail
-
add
public void add(PropertyData propertyData)
- Specified by:
addin interfaceSimpleMapperBuilder
-
add
public void add(PropertyData propertyData, AbstractIdMapper idMapper)
Description copied from interface:SimpleIdMapperBuilderAdd a custom identifier mapper to the builder.- Specified by:
addin interfaceSimpleIdMapperBuilder- Parameters:
propertyData- the property dataidMapper- the mapper
-
mapToEntityFromMap
public boolean mapToEntityFromMap(Object obj, Map data)
- Specified by:
mapToEntityFromMapin interfaceIdMapper- Parameters:
obj- Object to map to.data- Data to map.- Returns:
- True if data was mapped; false otherwise (when the id is
null).
-
mapToIdFromMap
public Object mapToIdFromMap(Map data)
- Specified by:
mapToIdFromMapin interfaceIdMapper
-
mapToIdFromEntity
public Object mapToIdFromEntity(Object data)
- Specified by:
mapToIdFromEntityin interfaceIdMapper
-
mapToMapFromId
public void mapToMapFromId(Map<String,Object> data, Object obj)
- Specified by:
mapToMapFromIdin interfaceIdMapper
-
mapToMapFromEntity
public void mapToMapFromEntity(Map<String,Object> data, Object obj)
- Specified by:
mapToMapFromEntityin interfaceIdMapper
-
mapToEntityFromEntity
public void mapToEntityFromEntity(Object objTo, Object objFrom)
- Specified by:
mapToEntityFromEntityin classAbstractIdMapper
-
prefixMappedProperties
public IdMapper prefixMappedProperties(String prefix)
Description copied from interface:IdMapperCreates a mapper with all mapped properties prefixed. A mapped property is a property which is directly mapped to values (not composite).- Specified by:
prefixMappedPropertiesin interfaceIdMapper- Parameters:
prefix- Prefix to add to mapped properties- Returns:
- A copy of the current property mapper, with mapped properties prefixed.
-
mapToQueryParametersFromId
public List<QueryParameterData> mapToQueryParametersFromId(Object obj)
- Specified by:
mapToQueryParametersFromIdin interfaceIdMapper- Parameters:
obj- Id from which to map.- Returns:
- A set parameter data, needed to build a query basing on the given id.
-
-