File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
hibernate-core/src/test/java/org/hibernate/orm/test/query Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 1212import jakarta .persistence .Id ;
1313
1414import org .hibernate .testing .orm .junit .DomainModel ;
15+ import org .hibernate .testing .orm .junit .Jira ;
1516import org .hibernate .testing .orm .junit .JiraKey ;
1617import org .hibernate .testing .orm .junit .SessionFactory ;
1718import org .hibernate .testing .orm .junit .SessionFactoryScope ;
@@ -91,6 +92,24 @@ public void testPartialLimitOffsetOnNativeQuery(SessionFactoryScope scope) {
9192 );
9293 }
9394
95+ @ Test
96+ @ Jira ( "https://hibernate.atlassian.net/browse/HHH-18309" )
97+ public void testLimitOffsetZeroValue (SessionFactoryScope scope ) {
98+ scope .inTransaction ( session -> {
99+ List <Long > l = session .createNativeQuery ( "select id from Person where name like :name" , Long .class )
100+ .setParameter ( "name" , "J%" )
101+ .setFirstResult ( 0 )
102+ .getResultList ();
103+ assertEquals ( 5 , l .size () );
104+
105+ l = session .createNativeQuery ( "select id from Person where name like :name" , Long .class )
106+ .setParameter ( "name" , "J%" )
107+ .setMaxResults ( 0 )
108+ .getResultList ();
109+ assertEquals ( 0 , l .size () );
110+ } );
111+ }
112+
94113 @ Entity (name = "Person" )
95114 public static class Person {
96115 @ Id
You can’t perform that action at this time.
0 commit comments