return Collections.emptyList();
}
DatabaseSession session = sessionFactory.getSession();
- StringBuilder hql = new StringBuilder().append("from ").append(Rule.class.getSimpleName()).append(" r where r.id in (:ids) and status<>:status ");
- Query hqlQuery = session.createQuery(hql.toString())
- .setParameter("status", Rule.STATUS_REMOVED)
- .setParameter("ids", ruleIds);
+ StringBuilder hql = new StringBuilder().append("from ").append(Rule.class.getSimpleName()).append(" r where r.id in (:ids)");
+ Query hqlQuery = session.createQuery(hql.toString()).setParameter("ids", ruleIds);
return hqlQuery.getResultList();
}
public void should_find_by_ids() {
setupData("shared");
DefaultRuleFinder finder = new DefaultRuleFinder(getSessionFactory());
- // 2 is disabled
- assertThat(finder.findByIds(newArrayList(2, 3))).hasSize(1);
+ // 2 is returned even its status is REMOVED
+ assertThat(finder.findByIds(newArrayList(2, 3))).hasSize(2);
}
@Test