I have a query that goes like "SELECT e.id, ... FROM ... WHERE e.id IN :ids". 
Parameter ids is a list of ids. When it is empty and I execute the query, 
OpenJPA throws java.lang.IllegalArgumentException: Input parameter "ids" is 
empty.

Why not just return an empty list? I feel this is much like iterating over an 
empty Collection: by not throwing an exception you get less complex code than 
when you have to write an if statement to handle empty collections.

Regards,
Henno Vermeulen
Huize Molenaar

Reply via email to