| The attached test case works, giving the SQL: select concrete2x0_.entityId as col_0_0_ from CON2 concrete2x0_ order by concrete2x0_.entityId ASC select concrete1x0_.entityId as col_0_0_ from CON1 concrete1x0_ order by concrete1x0_.entityId ASC and a warning: HHH000180: FirstResult/maxResults specified on polymorphic query; applying in memory! Limits are not specified in the test case, regardless, this can be done in the database as: (select entityId from CON2 union all select entityId from CON1) order by entityId ASC And even with limits and sort conditions it can be done as: select * from ( (select * from (select entityId from CON2 order by entityId ASC) where rownum <= 10) UNION ALL (select * from (select entityId from CON1 order by entityId ASC) where rownum <= 10) ) where rownum <= 10 order by entityId ASC and also more generally with LIMIT and more sort columns, I believe. |