I don't have the immediate solution but it might give you other ideas...
one part of the interesting code for you is here apparently:
in JPQL class:
public String createFindByQuery(String entityName, String entityClass, String query, Object... params) {
if (query == null || query.trim().length() == 0) {
return "from " + entityName;
}
if (query.matches("^by[A-Z].*$")) {
return "from " + entityName + " where " + findByToJPQL(query);
}
if (query.trim().toLowerCase().startsWith("select ")) {
return query;
}
if (query.trim().toLowerCase().startsWith("from ")) {
return query;
}
if (query.trim().toLowerCase().startsWith("order by ")) {
return "from " + entityName + " " + query;
}
if (query.trim().indexOf(" ") == -1 && query.trim().indexOf("=") == -1 && params != null && params.length == 1) {
query += " = ?1";
}
if (query.trim().indexOf(" ") == -1 && query.trim().indexOf("=") == -1 && params == null) {
query += " = null";
}
return "from " + entityName + " where " + query;
}
First of all, it seems your function awaits an object array of params. But your own array is 1 param so your array itself should be put in an object array...
int[][] myArray = new int[1][] ;
myArray[0][]=new int[] { 1, 2 };
and you try...
If it doesn't work, other ideas:
The IN is not explicitly managed anywhere in this class but I looked quickly.
You could try to build as a param a String "(1, 2)" (the SQL representation of the list)
Object[] params = new Object[1];
params[0] = "(1,2)";
Exponent.find("
select exp from Exponent exp
where exp.id IN ?", params).fetch();
maybe you could try:
Exponent.find("
exp.id IN ?", myArray).fetch();
and the horrible clutch:
Exponent.find("select exp from Exponent exp
where
exp.id IN "+JOIN_YOU_ARRAY_AS_A_SQL_LIST, myArray).fetch();
regards
Pascal