JPQL (JPA) search substring
Posted
by JavaBeginner
on Stack Overflow
See other posts from Stack Overflow
or by JavaBeginner
Published on 2010-04-30T21:44:29Z
Indexed on
2010/04/30
21:47 UTC
Read the original article
Hit count: 455
Hi, Im facing simple problem with searching entities by some (sub)string, which they might contain.
E.g. I have users user1, usr2, useeeer3, user4 and I will enter to search window "use" and I expect to return user1, useeer3, user4.
Im sure you know what I mean now. Is there any construction in JPA (JQPL)? It would be nice to search using WHERE somehow in named queries. Something like "SELECT u FROM User u WHERE u.nickname contains :substring"
© Stack Overflow or respective owner