I am new to Hibernate Restrictions and need some help:
I am having a scenario that I need to find all the records where "identifier" is "HB001" or "HB002", "HB003" &"HB004". That is to say, it should return 4 rows, each row has "identifier" as "HB00*".
//here is the code
Criteria criteria = hibernateSession.createCriteria(ENTITY_CLASS);
List<String> ids = getIds(); //ids contains "HB001", "HB002", "HB003", "HB004" and I am sure this step has no issue.
criteria.add(Restrictions.eq("identifier", ids));
...
looks like the criteria.add(Restrictions.eq("identifier", ids))
is not correct and the query returns null.
Can anyone help?