It should repeat the
like because I am restricting the column to what the user passed in. So, the user could pass in '1234567', '1235234', '98556%', '56701345' and therefore column1 would be restricted to '1234567'
or '1235234'
or '98556%'
or '56701345'
Code:
public static int getRowCount(List<String> arg) {
log.debug("getRowCount");
Integer ret = null;
if (null != arg) {
ret = (Integer)SessionFactory.getSession().createCriteria(TableA.class)
.setProjection(Projections.rowCount())
.add(restrictColumn1(arg)).uniqueResult();
}
return ret;
}
private static Junction restrictColumn1(List<String> args) {
Junction junction = Restrictions.disjunction();
for (String arg : args)
junction.add(Restrictions.like("Column1", arg));
return junction;
}