Beginner |
|
Joined: Tue Jul 03, 2007 11:11 am Posts: 22
|
Hi All Is it possible to get Set directly from HibernateTemplate or Hibernate Criteria API? Instead off getting list first and creating new Set from it as so:
[code] public Set findCarsByIdentifiers(final List identifiers) { List list = getHibernateTemplate().executeFind(new HibernateCallback() { public Object doInHibernate(Session session) throws HibernateException, SQLException { Query query = session.createQuery("from Car car where car.identifier in (:identifiers)"); query.setParameterList("identifiers", identifiers); return query.list(); } }); return new HashSet(list); }[/code]
Thank you!
|
|