diff --git a/documentation/src/main/asciidoc/userguide/chapters/query/hql/HQL.adoc b/documentation/src/main/asciidoc/userguide/chapters/query/hql/HQL.adoc index aa4257b45a..8d3c321060 100644 --- a/documentation/src/main/asciidoc/userguide/chapters/query/hql/HQL.adoc +++ b/documentation/src/main/asciidoc/userguide/chapters/query/hql/HQL.adoc @@ -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] diff --git a/documentation/src/test/java/org/hibernate/userguide/hql/HQLTest.java b/documentation/src/test/java/org/hibernate/userguide/hql/HQLTest.java index 084a41af2c..e7295231e7 100644 --- a/documentation/src/test/java/org/hibernate/userguide/hql/HQLTest.java +++ b/documentation/src/test/java/org/hibernate/userguide/hql/HQLTest.java @@ -1145,7 +1145,7 @@ public class HQLTest extends BaseEntityManagerFunctionalTestCase { doInJPA( this::entityManagerFactory, entityManager -> { //tag::hql-substring-function-example[] List 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();