HHH-11482 Update example and documentation to clarify SUBSTRING is 1-based

This commit is contained in:
Mark Rotteveel 2017-02-11 18:14:48 +01:00 committed by Vlad Mihalcea
parent 8775007e7c
commit 828fb09eb8
2 changed files with 3 additions and 2 deletions

View File

@ -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]

View File

@ -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();