Convert from List to IN params for SQL
public static <T> String getWithINParam(List<T> paraList) {
try {
if (null != paraList)
return paraList.stream().map(s -> new StringBuilder("'").append(s).append("'")).collect(joining(","));
} catch (Exception e) {
LOG.error("Error in setting IN para for SQL ", e);
}
return "''";
}
0 comments:
Post a Comment