Skip to content

Commit

Permalink
HHH-3693 : implicit polymorphism + pagination
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.jboss.org/repos/hibernate/core/branches/Branch_3_2@15754 1b8cb986-b30d-0410-93ca-fae66ebed9b2
  • Loading branch information
sebersole committed Jan 7, 2009
1 parent 09025c3 commit e80a934
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/org/hibernate/engine/query/HQLQueryPlan.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public List performList(
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++;
Expand Down
23 changes: 23 additions & 0 deletions test/org/hibernate/test/hql/ASTParserLoadingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,29 @@ public static Test suite() {
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();
Expand Down

0 comments on commit e80a934

Please sign in to comment.