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 12
12
import jakarta .persistence .Id ;
13
13
14
14
import org .hibernate .testing .orm .junit .DomainModel ;
15
+ import org .hibernate .testing .orm .junit .Jira ;
15
16
import org .hibernate .testing .orm .junit .JiraKey ;
16
17
import org .hibernate .testing .orm .junit .SessionFactory ;
17
18
import org .hibernate .testing .orm .junit .SessionFactoryScope ;
@@ -91,6 +92,24 @@ public void testPartialLimitOffsetOnNativeQuery(SessionFactoryScope scope) {
91
92
);
92
93
}
93
94
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
+
94
113
@ Entity (name = "Person" )
95
114
public static class Person {
96
115
@ Id
You can’t perform that action at this time.
0 commit comments