About substring

manual

Strings in JPQL and Criteria Queries

Explains string expressions in JPQL queries, including LIKE, LOCATE, LOWER, UPPER, TRIM, CONCAT and SUBSTRING.... CONCAT - String Concatenation SUBSTRING - Getting a Portion of a String Java String Methods ... The LOCATE(str, substr [, start]) function searches a substring and returns its position. For example: ...

 
api-jpa

substring(x, from)

Create an expression for substring extraction.(Method of javax.persistence.criteria.CriteriaBuilder)

 
api-jpa

substring(x, from)

Create an expression for substring extraction.(Method of javax.persistence.criteria.CriteriaBuilder)

 
api-jpa

substring(x, from, len)

Create an expression for substring extraction.(Method of javax.persistence.criteria.CriteriaBuilder)

 
api-jpa

substring(x, from, len)

Create an expression for substring extraction.(Method of javax.persistence.criteria.CriteriaBuilder)

 
forum_thread

substring works with string but not with char

i want to select all entities whose name starts with a specific letter, i can use this query with a string parameter select f from Foo f where substring(f.name, 1, 1) = ?1 but when i use a char, the query does not return anything. i think it should also be possible to use char/Character types, do you agree? ... parameter SELECT f FROM Foo f WHERE substring ( f . name , 1 , 1 ) = ? 1 ...

 
api-jpa

substring(x, from, len)

Create an expression for substring extraction.(Method of javax.persistence.criteria.CriteriaBuilder)

 
api-jpa

javax.persistence.criteria.CriteriaBuilder

Used to construct criteria queries, compound selections, expressions, predicates, orderings.(Interface of JPA)

 
manual

JPA Query Expressions (JPQL / Criteria)

Describes JPA query (JPQL / Criteria API) expressions (literals, operators and functions).... See JavaDoc Reference Page... , substring substring(x, from) CriteriaBuilder's method Create an expression ...

 
manual

GROUP BY and HAVING clauses

Explains how to use the GROUP BY and HAVING clauses in a JPA/JPQL query.... all the countries by their first letter: SELECT SUBSTRING(c.name, 1, 1) FROM Country c GROUP BY SUBSTRING(c.name, 1, 1); The FROM clause defines iteration over all the ...