E.g.
Generated sql:
Code:
1. select
parent.pid as pid2_,
...
from
Parent parent
where
(
1=1
)
and (
parent.attribute1 is null
)
and (
parent.attribute2 is null
or parent.attribute2<?
)
order by
parent.pid limit ?|#]
2. select
child.parent_pid as parentpid_1_,
child.pid as pid1_,
...
from
Child child
where
(
1=1
)
and child.parent_pid in (
select
parent.pid
from
Parent parent
where
(
1=1
)
and (
parent.attribute1 is null
)
and (
parent.attribute2 is null
or parent.attribute2<?
)
)|#]
Note the missing limit in the last where clause.
The problem arises because of the fetchtype=eager on the child relation.
Is there any way to disable this fetchtype on a single query (the one with setMaxResults)?
Best regards Trym