cancel
Showing results for 
Search instead for 
Did you mean: 

Using IN clause in custom Activiti queries

neh
Champ in-the-making
Champ in-the-making
Hi,

I was referring to http://www.jorambarrez.be/blog/2014/01/17/execute-custom-sql-in-activiti/ to build a custom activiti query using the IN clause. When I pass a list of strings as the variableNames to the below MyTestMapper interface I get this error:

org.apache.ibatis.binding.BindingException: Parameter 'variableNames' not found


The mapper looks something like:

public interface MyTestMapper {

@Select({
  "SELECT task.ID_ as taskId, variable.LONG_ as variableValue FROM ACT_RU_VARIABLE variable",
  "inner join ACT_RU_TASK task on variable.TASK_ID_ = task.ID_",
  "where variable.NAME_ in (#{variableNames})"
})
List<Map<String, Object>> selectTaskWithSpecificVariable(List<String> variableNames);

}

So I was wondering what's the correct way to pass in lists and us IN clause for custom queries? Is there an example somewhere I can refer to?
1 REPLY 1

neh
Champ in-the-making
Champ in-the-making
adding the mapper again with proper formatting:

<java>
public interface MyTestMapper {

@Select({
"SELECT task.ID_ as taskId, variable.LONG_ as variableValue FROM ACT_RU_VARIABLE variable",
"inner join ACT_RU_TASK task on variable.TASK_ID_ = task.ID_",
"where variable.NAME_ in (#{variableNames})"
})
List<Map<String, Object>> selectTaskWithSpecificVariable(List<String> variableNames);

}