Hi, I have many-to-many association between Book and KeyWord. I can find all Books written by given list of authors with the criteria query
Code:
Criteria criteria=session.createCriteria(Book.class);
criteria.createAlias("keyWords", "kw" );
criteria.add(org.hibernate.criterion.Expression.in("kw.word", authors))
.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
But now, i want to replace the condiditon
Code:
word=author[0] or word=author[1]....
with
Code:
word like '%author[0]%' or word like '%author[1]%' ...
I can't imagine how to write this query at all :( Could you please help me?