HHH-11482 Update example and documentation to clarify SUBSTRING is 1-based
This commit is contained in:
parent
8775007e7c
commit
828fb09eb8
|
@ -1128,7 +1128,8 @@ include::{sourcedir}/HQLTest.java[tags=hql-concat-function-example]
|
|||
|
||||
SUBSTRING::
|
||||
Extracts a portion of a string value.
|
||||
The second argument denotes the starting position. The third (optional) argument denotes the length.
|
||||
The second argument denotes the starting position, where 1 is the first character of the string.
|
||||
The third (optional) argument denotes the length.
|
||||
|
||||
====
|
||||
[source, JAVA, indent=0]
|
||||
|
|
|
@ -1145,7 +1145,7 @@ public class HQLTest extends BaseEntityManagerFunctionalTestCase {
|
|||
doInJPA( this::entityManagerFactory, entityManager -> {
|
||||
//tag::hql-substring-function-example[]
|
||||
List<String> prefixes = entityManager.createQuery(
|
||||
"select substring( p.number, 0, 2 ) " +
|
||||
"select substring( p.number, 1, 2 ) " +
|
||||
"from Call c " +
|
||||
"join c.phone p", String.class )
|
||||
.getResultList();
|
||||
|
|
Loading…
Reference in New Issue