I have a piece of code
public List<Fruit> getFruits(final Set<Integer> ids) {
final Criteria criteria = super.criteria().add(Restrictions.in("id", ids));
final List<Fruit> fruits = this.list(criteria); // throws SQLGrammarException
fruits.forEach(this::initializeFruit);
return fruits;
}
When empty set provided, it will throw exception in this.list(criteria), 'org.hibernate.exception.SQLGrammarException' exception. Could not extract ResultSet
Any suggestions how can I prevent?
Thanks!