Is
the regIdList
a result of another query? Then you can try to do this in one Select.
Von:
eclipselink-users-bounces@xxxxxxxxxxx
[mailto:eclipselink-users-bounces@xxxxxxxxxxx] Im Auftrag von Sri
Sankaran
Gesendet: Freitag, 24. September 2010 05:17
An: eclipselink-users@xxxxxxxxxxx
Betreff: [eclipselink-users] Query hitting in-clause limit
Using
Eclipselink 2.0 against Oracle 11g database
I
have a query that is resulting in an ORA-01795 error. This means that the
in-clause has more than 1000 values.
The
logic in Java that triggers this result goes something like this:
List<Long>
regIdList = A large list of IDs
Query
q = entityManager.createQuery(“Select r from Registration r where
r.registrationId in :regIds”);
q.setParameter(“regIds”,
regIdList);
List<Registration>
results = q.getResultList();
I
have a business need to be able to pull all that data.
What
is the recommended recourse? I really like Eclipselink’s ability to
consume a list to construct the appropriate in-clause. It would be nice
if Eclipselink could recognize that the size of the list exceeds Oracle’s limit
and then chunks it appropriately.