Class MiddleMapKeyPropertyComponentMapper

  • All Implemented Interfaces:

    public class MiddleMapKeyPropertyComponentMapper
    extends Object
    implements MiddleComponentMapper
    A component mapper for the @MapKey mapping with the name parameter specified: the value of the map's key is a property of the entity. This doesn't have an effect on the data stored in the versions tables, so mapToMapFromObject is empty.
    • Constructor Detail

      • MiddleMapKeyPropertyComponentMapper

        public MiddleMapKeyPropertyComponentMapper​(String propertyName,
                                                   String accessType)
    • Method Detail

      • mapToObjectFromFullMap

        public Object mapToObjectFromFullMap​(EntityInstantiator entityInstantiator,
                                             Map<String,​Object> data,
                                             Object dataObject,
                                             Number revision)
        Description copied from interface: MiddleComponentMapper
        Maps from full object data, contained in the given map (or object representation of the map, if available), to an object.
        Specified by:
        mapToObjectFromFullMap in interface MiddleComponentMapper
        entityInstantiator - An entity instatiator bound with an open versions reader.
        data - Full object data.
        dataObject - An optional object representation of the data.
        revision - Revision at which the data is read.
        An object with data corresponding to the one found in the given map.
      • addMiddleEqualToQuery

        public void addMiddleEqualToQuery​(Parameters parameters,
                                          String idPrefix1,
                                          String prefix1,
                                          String idPrefix2,
                                          String prefix2)
        Description copied from interface: MiddleComponentMapper
        Adds query statements, which contains restrictions, which express the property that part of the middle entity with alias prefix1, is equal to part of the middle entity with alias prefix2 (the entity is the same). The part is the component's representation in the middle entity.
        Specified by:
        addMiddleEqualToQuery in interface MiddleComponentMapper
        parameters - Parameters, to which to add the statements.
        idPrefix1 - First alias of the entity + prefix + id to add to the properties.
        prefix1 - First alias of the entity + prefix to add to the properties.
        idPrefix2 - Second alias of the entity + prefix + id to add to the properties.
        prefix2 - Second alias of the entity + prefix to add to the properties.