Class NamedQueryMapper<T>

  • Type Parameters:
    T - the result type expected to be returned
    All Implemented Interfaces:
    Serializable, QueryResultMapper<T>

    public class NamedQueryMapper<T>
    extends Object
    implements QueryResultMapper<T>
    A delegate mapper that will delay look up of actual mapper to the time its map method is invoked. Especially useful for EJB remote usage when dependency to api only is preferred and the actual implementations will be found on server side.
    See Also:
    Serialized Form
    • Constructor Detail

      • NamedQueryMapper

        public NamedQueryMapper​(String mapperName)
        Creates new instance with actual mapper name
        Parameters:
        mapperName - unique name of the mapper that will be used to produce results.
    • Method Detail

      • map

        public T map​(Object result)
        Description copied from interface: QueryResultMapper
        Based on raw data set returns mapped/transformed data. Usually it will get set of raw data and return list (or collection in general) of custom object like ProcessInstance or UserTaskInstance.
        Specified by:
        map in interface QueryResultMapper<T>
        Parameters:
        result - raw data set in custom format
        Returns:
        mapped result of raw data set
      • getType

        public Class<?> getType()
        Description copied from interface: QueryResultMapper
        Returns type of the data produced by this mapper. If the type is collection then the returned type should be type of the elements in collection e.g.:
        List<ProcessInstanceDesc> returned type should be ProcessInstanceDesc.class
        Specified by:
        getType in interface QueryResultMapper<T>
        Returns:
        type
      • forColumnMapping

        public QueryResultMapper<T> forColumnMapping​(Map<String,​String> columnMapping)
        Description copied from interface: QueryResultMapper
        Returns new instance of the mapper for given column mapping
        Specified by:
        forColumnMapping in interface QueryResultMapper<T>
        Parameters:
        columnMapping - provides column mapping (name to type) that can be shipped to mapper for improved transformation - can be null (accepted types: string, long, integer, date, double)
        Returns:
        new instance of the mapper configured with column mapping