If you do
LIKE :code
and then do
namedQuery.setParameter("code", "%" + this.value + "%");
Then value remains free from the ‘%’ sign. If you need to use it somewhere else in the same query simply use another parameter name other than ‘code’ .
More Related Contents:
- JPA: JOIN in JPQL
- The JPA hashCode() / equals() dilemma
- JPQL Create new Object In Select Statement – avoid or embrace?
- Adding IN clause List to a JPA Query
- Please explain about insertable=false and updatable=false in reference to the JPA @Column annotation
- How to use multiple JOIN FETCH in one JPQL query
- Limit number of results in JPQL
- stream on JPA lazy list
- How To Define a JPA Repository Query with a Join
- Using the JPA Criteria API, can you do a fetch join that results in only one join?
- Doing an “IN” query with Hibernate
- Setting a parameter as a list for an IN expression
- JPQL: Receiving a Collection in a Constructor Expression
- How can I avoid the Warning “firstResult/maxResults specified with collection fetch; applying in memory!” when using Hibernate?
- Java8 Collections.sort (sometimes) does not sort JPA returned lists
- IN-clause in HQL or Java Persistence Query Language
- Disable caching in JPA (eclipselink)
- JPA Native Query select and cast object
- Spring Data JPA and Exists query
- JPQL Like Case Insensitive
- No operator matches the given name and argument type(s). You might need to add explicit type casts. — Netbeans, Postgresql 8.4 and Glassfish
- Is it possible to write a generic enum converter for JPA?
- How to create a JPA query with LEFT OUTER JOIN
- Why does this stream return no element?
- What’s the difference between the IN and MEMBER OF JPQL operators?
- EclipseLink 2.7.0 and JPA API 2.2.0 – signature mismatch
- What is a JPA implementation?
- JPA Select latest instance for each item
- How to use Postgres JSONB datatype with JPA?
- @XmlPath has no impact during the JAXB Marshalling