Author: steve.ebersole(a)jboss.com
Date: 2009-01-07 15:38:25 -0500 (Wed, 07 Jan 2009)
New Revision: 15754
Modified:
core/branches/Branch_3_2/src/org/hibernate/engine/query/HQLQueryPlan.java
core/branches/Branch_3_2/test/org/hibernate/test/hql/ASTParserLoadingTest.java
Log:
HHH-3693 : implicit polymorphism + pagination
Modified: core/branches/Branch_3_2/src/org/hibernate/engine/query/HQLQueryPlan.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/engine/query/HQLQueryPlan.java 2009-01-07
20:33:16 UTC (rev 15753)
+++ core/branches/Branch_3_2/src/org/hibernate/engine/query/HQLQueryPlan.java 2009-01-07
20:38:25 UTC (rev 15754)
@@ -181,7 +181,7 @@
final int size = tmp.size();
for ( int x = 0; x < size; x++ ) {
final Object result = tmp.get( x );
- if ( distinction.add( result ) ) {
+ if ( ! distinction.add( result ) ) {
continue;
}
includedCount++;
Modified: core/branches/Branch_3_2/test/org/hibernate/test/hql/ASTParserLoadingTest.java
===================================================================
---
core/branches/Branch_3_2/test/org/hibernate/test/hql/ASTParserLoadingTest.java 2009-01-07
20:33:16 UTC (rev 15753)
+++
core/branches/Branch_3_2/test/org/hibernate/test/hql/ASTParserLoadingTest.java 2009-01-07
20:38:25 UTC (rev 15754)
@@ -100,6 +100,29 @@
return new FunctionalTestClassTestSuite( ASTParserLoadingTest.class );
}
+ public void testPaginationWithPolymorphicQuery() {
+ Session s = openSession();
+ s.beginTransaction();
+ Human h = new Human();
+ h.setName( new Name( "Steve", null, "Ebersole" ) );
+ s.save( h );
+ s.getTransaction().commit();
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ List results = s.createQuery( "from java.lang.Object" ).setMaxResults( 2
).list();
+ assertEquals( 1, results.size() );
+ s.getTransaction().commit();
+ s.close();
+
+ s = openSession();
+ s.beginTransaction();
+ s.delete( h );
+ s.getTransaction().commit();
+ s.close();
+ }
+
public void testComponentNullnessChecks() {
Session s = openSession();
s.beginTransaction();
Show replies by date