Class AbstractIdMapper
- java.lang.Object
-
- org.hibernate.envers.internal.entities.mapper.AbstractMapper
-
- org.hibernate.envers.internal.entities.mapper.id.AbstractIdMapper
-
- All Implemented Interfaces:
IdMapper
- Direct Known Subclasses:
AbstractCompositeIdMapper
,SingleIdMapper
public abstract class AbstractIdMapper extends AbstractMapper implements IdMapper
The base abstract class implementation for identifier mappers.
-
-
Constructor Summary
Constructors Constructor Description AbstractIdMapper(ServiceRegistry serviceRegistry)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addIdEqualsToQuery(Parameters parameters, Object id, String alias, String prefix, boolean equals)
Adds query statements, which contains restrictions, which express the property that the id of the entity with alias prefix, is equal to the given object.void
addIdsEqualToQuery(Parameters parameters, String prefix1, String prefix2)
Adds query statements, which contains restrictions, which express the property that the id of the entity with alias prefix1, is equal to the id of the entity with alias prefix2 (the entity is the same).void
addIdsEqualToQuery(Parameters parameters, String prefix1, IdMapper mapper2, String prefix2)
Adds query statements, which contains restrictions, which express the property that the id of the entity with alias prefix1, is equal to the id of the entity with alias prefix2 mapped by the second mapper (the second mapper must be for the same entity, but it can have, for example, prefixed properties).void
addNamedIdEqualsToQuery(Parameters parameters, String prefix, boolean equals)
Adds query statements, which contains named parameters, which express the property that the id of the entity with alias prefix, is equal to the given object.void
addNamedIdEqualsToQuery(Parameters parameters, String prefix1, IdMapper mapper, boolean equals)
Adds query statements, which contains named parameters that express the property that the id of the entity with alias prefix is equal to the given object using the specified mapper.void
addNullableIdsEqualToQuery(Parameters parameters, String prefix1, IdMapper mapper2, String prefix2)
Adds query statements, which contains restrictions, which express the property that the id of the entity with alias prefix1, is equal to the id of the entity with alias prefix2 mapped by the second mapper (the second mapper must be for the same entity, but it can have, for example, prefixed properties).protected void
getAndSetValue(PropertyData propertyData, Object source, Object destination)
ServiceRegistry
getServiceRegistry()
protected <T> T
getValueFromObject(PropertyData propertyData, Object object)
abstract void
mapToEntityFromEntity(Object objectTo, Object objectFrom)
protected void
setValueOnObject(PropertyData propertyData, Object object, Object value)
-
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
mapToEntityFromMap, mapToIdFromEntity, mapToIdFromMap, mapToMapFromEntity, mapToMapFromId, mapToMapFromId, mapToQueryParametersFromId, prefixMappedProperties
-
-
-
-
Constructor Detail
-
AbstractIdMapper
public AbstractIdMapper(ServiceRegistry serviceRegistry)
-
-
Method Detail
-
getServiceRegistry
public ServiceRegistry getServiceRegistry()
- Specified by:
getServiceRegistry
in interfaceIdMapper
-
addIdsEqualToQuery
public void addIdsEqualToQuery(Parameters parameters, String prefix1, String prefix2)
Description copied from interface:IdMapper
Adds query statements, which contains restrictions, which express the property that the id of the entity with alias prefix1, is equal to the id of the entity with alias prefix2 (the entity is the same).- Specified by:
addIdsEqualToQuery
in interfaceIdMapper
- Parameters:
parameters
- Parameters, to which to add the statements.prefix1
- First alias of the entity + prefix to add to the properties.prefix2
- Second alias of the entity + prefix to add to the properties.
-
addIdsEqualToQuery
public void addIdsEqualToQuery(Parameters parameters, String prefix1, IdMapper mapper2, String prefix2)
Description copied from interface:IdMapper
Adds query statements, which contains restrictions, which express the property that the id of the entity with alias prefix1, is equal to the id of the entity with alias prefix2 mapped by the second mapper (the second mapper must be for the same entity, but it can have, for example, prefixed properties).- Specified by:
addIdsEqualToQuery
in interfaceIdMapper
- Parameters:
parameters
- Parameters, to which to add the statements.prefix1
- First alias of the entity + prefix to add to the properties.mapper2
- Second mapper for the same entity, which will be used to get properties for the right side of the equation.prefix2
- Second alias of the entity + prefix to add to the properties.
-
addNullableIdsEqualToQuery
public void addNullableIdsEqualToQuery(Parameters parameters, String prefix1, IdMapper mapper2, String prefix2)
Description copied from interface:IdMapper
Adds query statements, which contains restrictions, which express the property that the id of the entity with alias prefix1, is equal to the id of the entity with alias prefix2 mapped by the second mapper (the second mapper must be for the same entity, but it can have, for example, prefixed properties).- Specified by:
addNullableIdsEqualToQuery
in interfaceIdMapper
- Parameters:
parameters
- Parameters, to which to add the statements.prefix1
- First alias of the entity + prefix to add to the properties.mapper2
- Second mapper for the same entity, which will be used to get properties for the right side of the equation.prefix2
- Second alias of the entity + prefix to add to the properties.
-
addIdEqualsToQuery
public void addIdEqualsToQuery(Parameters parameters, Object id, String alias, String prefix, boolean equals)
Description copied from interface:IdMapper
Adds query statements, which contains restrictions, which express the property that the id of the entity with alias prefix, is equal to the given object.- Specified by:
addIdEqualsToQuery
in interfaceIdMapper
- Parameters:
parameters
- Parameters, to which to add the statements.id
- Value of id.alias
- the alias to use in the specified parameters (may be null).prefix
- Prefix to add to the properties (may be null).equals
- Should this query express the "=" relation or the "<>" relation.
-
addNamedIdEqualsToQuery
public void addNamedIdEqualsToQuery(Parameters parameters, String prefix, boolean equals)
Description copied from interface:IdMapper
Adds query statements, which contains named parameters, which express the property that the id of the entity with alias prefix, is equal to the given object. It is the responsibility of the using method to read parameter values from the id and specify them on the final query object.- Specified by:
addNamedIdEqualsToQuery
in interfaceIdMapper
- Parameters:
parameters
- Parameters, to which to add the statements.prefix
- Prefix to add to the properties (may be null).equals
- Should this query express the "=" relation or the "<>" relation.
-
addNamedIdEqualsToQuery
public void addNamedIdEqualsToQuery(Parameters parameters, String prefix1, IdMapper mapper, boolean equals)
Description copied from interface:IdMapper
Adds query statements, which contains named parameters that express the property that the id of the entity with alias prefix is equal to the given object using the specified mapper.- Specified by:
addNamedIdEqualsToQuery
in interfaceIdMapper
- Parameters:
parameters
- Parameters, to which to add the statements.prefix1
- Prefix to add to the properties (may be null).mapper
- The identifier mapper to useequals
- Should this query express the "=" relation or the "<>" relation.
-
mapToEntityFromEntity
public abstract void mapToEntityFromEntity(Object objectTo, Object objectFrom)
-
getValueFromObject
protected <T> T getValueFromObject(PropertyData propertyData, Object object)
-
setValueOnObject
protected void setValueOnObject(PropertyData propertyData, Object object, Object value)
-
getAndSetValue
protected void getAndSetValue(PropertyData propertyData, Object source, Object destination)
-
-