HHH-3693 : implicit polymorphism + pagination

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@15753 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Steve Ebersole 2009-01-07 20:33:16 +00:00
parent 50ec688066
commit 54b9e03c22
2 changed files with 24 additions and 1 deletions

View File

@ -205,7 +205,7 @@ public class HQLQueryPlan implements Serializable {
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++;

View File

@ -102,6 +102,29 @@ public class ASTParserLoadingTest extends FunctionalTestCase {
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();