Package org.jbpm.services.api.query
Class NamedQueryMapper<T>
- java.lang.Object
-
- org.jbpm.services.api.query.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 itsmap
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
-
-
Field Summary
-
Fields inherited from interface org.jbpm.services.api.query.QueryResultMapper
COLUMN_ACTIVATIONTIME, COLUMN_ACTUALOWNER, COLUMN_CORRELATIONKEY, COLUMN_CREATEDBY, COLUMN_CREATEDON, COLUMN_DEPLOYMENTID, COLUMN_DESCRIPTION, COLUMN_DUEDATE, COLUMN_DURATION, COLUMN_END, COLUMN_ERROR, COLUMN_ERROR_ACK, COLUMN_ERROR_ACK_AT, COLUMN_ERROR_ACK_BY, COLUMN_ERROR_ACTIVITY_ID, COLUMN_ERROR_ACTIVITY_NAME, COLUMN_ERROR_DATE, COLUMN_ERROR_DEPLOYMENT_ID, COLUMN_ERROR_ID, COLUMN_ERROR_JOB_ID, COLUMN_ERROR_MSG, COLUMN_ERROR_PROCESS_ID, COLUMN_ERROR_PROCESS_INST_ID, COLUMN_ERROR_TYPE, COLUMN_EXCLUDED_OWNER, COLUMN_EXPIRATIONTIME, COLUMN_EXTERNALID, COLUMN_FORM_NAME, COLUMN_IDENTITY, COLUMN_JOB_BUSINESSKEY, COLUMN_JOB_COMMANDNAME, COLUMN_JOB_ID, COLUMN_JOB_MESSAGE, COLUMN_JOB_STATUS, COLUMN_JOB_TIMESTAMP, COLUMN_LASTMODIFICATION_DATE, COLUMN_LASTMODIFICATION_USER, COLUMN_NAME, COLUMN_ORGANIZATIONAL_ENTITY, COLUMN_OUTCOME, COLUMN_PARENTID, COLUMN_PARENTPROCESSINSTANCEID, COLUMN_POTOWNER, COLUMN_PRIORITY, COLUMN_PROCESS_LASTMODIFICATIONDATE, COLUMN_PROCESSID, COLUMN_PROCESSINSTANCEDESCRIPTION, COLUMN_PROCESSINSTANCEID, COLUMN_PROCESSNAME, COLUMN_PROCESSTYPE, COLUMN_PROCESSVERSION, COLUMN_SLA_COMPLIANCE, COLUMN_SLA_DUE_DATE, COLUMN_START, COLUMN_STATUS, COLUMN_SUBJECT, COLUMN_TASK_PROCESSID, COLUMN_TASK_PROCESSINSTANCEID, COLUMN_TASK_SLA_COMPLIANCE, COLUMN_TASK_SLA_DUE_DATE, COLUMN_TASK_STATUS, COLUMN_TASK_TYPE, COLUMN_TASK_VAR_NAME, COLUMN_TASK_VAR_TYPE, COLUMN_TASK_VAR_VALUE, COLUMN_TASKID, COLUMN_VAR_NAME, COLUMN_VAR_VALUE, COLUMN_WORKITEMID
-
-
Constructor Summary
Constructors Constructor Description NamedQueryMapper(String mapperName)
Creates new instance with actual mapper name
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QueryResultMapper<T>
forColumnMapping(Map<String,String> columnMapping)
Returns new instance of the mapper for given column mappingString
getName()
Returns unique name of this query result mapper implementation.Class<?>
getType()
Returns type of the data produced by this mapper.T
map(Object result)
Based on raw data set returns mapped/transformed data.
-
-
-
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 interfaceQueryResultMapper<T>
- Parameters:
result
- raw data set in custom format- Returns:
- mapped result of raw data set
-
getName
public String getName()
Description copied from interface:QueryResultMapper
Returns unique name of this query result mapper implementation.- Specified by:
getName
in interfaceQueryResultMapper<T>
- Returns:
- name
-
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 interfaceQueryResultMapper<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 interfaceQueryResultMapper<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
-
-