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 Details

    • AbstractIdMapper

      public AbstractIdMapper(ServiceRegistry serviceRegistry)
  • Method Details

    • getServiceRegistry

      public ServiceRegistry getServiceRegistry()
      Specified by:
      getServiceRegistry in interface IdMapper
    • 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 interface IdMapper
      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 interface IdMapper
      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 interface IdMapper
      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 interface IdMapper
      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 interface IdMapper
      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 interface IdMapper
      Parameters:
      parameters - Parameters, to which to add the statements.
      prefix1 - Prefix to add to the properties (may be null).
      mapper - The identifier mapper to use
      equals - 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)