HHH-3693 : implicit polymorphism + pagination
git-svn-id: https://svn.jboss.org/repos/hibernate/core/branches/Branch_3_2@15754 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
09025c36d4
commit
e80a934549
|
@ -181,7 +181,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++;
|
||||
|
|
|
@ -100,6 +100,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();
|
||||
|
|
Loading…
Reference in New Issue