It should be possible to search for keywords even if the keyword does not start with the specific search term.
This commit is contained in:
parent
c49ff3141a
commit
8b5fd352e3
@ -138,14 +138,13 @@ public class KeywordDaoJPAImp extends LazyDeleteAbstractDaoJPAImp<Keyword> imple
|
||||
}
|
||||
|
||||
@Override
|
||||
// TODO should be improved so that it is possible to search on "mining" and find "data mining"
|
||||
public List<Keyword> getAutoCompleteCapableSupervisors(final KeywordType keywordType, final String keywordName) {
|
||||
return getJpaTemplate().execute(new JpaCallback<List<Keyword>>() {
|
||||
public List<Keyword> doInJpa(EntityManager em) throws PersistenceException {
|
||||
TypedQuery<Keyword> query;
|
||||
query = em.createQuery("SELECT x FROM "+domainClassString+" x WHERE x.type = :type AND x.keyword LIKE :keywordName ORDER BY keyword", domainClass);
|
||||
query.setParameter("type", keywordType);
|
||||
String keyWordNameString = keywordName + "%";
|
||||
String keyWordNameString = "%" + keywordName + "%";
|
||||
query.setParameter("keywordName", keyWordNameString);
|
||||
query.setHint(QueryHints.HINT_CACHEABLE, "true");
|
||||
return query.getResultList();
|
||||
|
Loading…
x
Reference in New Issue
Block a user