firstResult/maxResults specified with collection fetch; applying in memory!

When you specify “left outer join” part of your query, Hibernate will retreive all elements into the memory.

You will see a warning “firstResult/maxResults specified with collection fetch; applying in memory!”. It is used to do pagination correctly.

select distinct department0_.DEPTNO as DEPTNO71_0_, location1_.LOCATION_ID as LOCATION1_54_1_, 
employees2_.EMPNO as EMPNO49_2_, department0_.LOCATION_ID as LOCATION3_71_0_, department0_.DNAME as DNAME71_0_, location1_.DESCRIPTION as DESCRIPT2_54_1_, 
employees2_.DEPTNO as DEPTNO49_2_, employees2_.ENAME as ENAME49_2_, 
employees2_.HIREDATE as HIREDATE49_2_, employees2_.DEPTNO as DEPTNO0__, 
employees2_.EMPNO as EMPNO0__ 
from DEPT department0_ inner join LOCATION location1_ on department0_.LOCATION_ID=location1_.LOCATION_ID 
left outer join EMP employees2_ on department0_.DEPTNO=employees2_.DEPTNO 
where (department0_.DNAME like ?) and employees2_.EMPNO=? order by employees2_.ENAME ASC
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: