Monday, 19 August 2013

Hibernate HQL IN clause only match first item of list

Hibernate HQL IN clause only match first item of list

The problem : IN clause of hql query matches only first item of a comma
separated list!
The HQL query is like this : from News where 93 IN (pictureIds)
News entity is :
public class News {
String id;
String pictureIds; // comma separated list of pictureIds
}
NOTE: if I change HQL query and hardcode the pictureIds its result is
correct!
How can I change my query to resolve the problem?

No comments:

Post a Comment