QueryDSL matching id using 'in' not working for huge list collection

Viewed 192

Hi i am trying to fetch records based on a condition whether particular id is present in a custom provided list...the query works fine for alist of size 15K records....but when i pass list with larger size it fails... i know there is a limitation in postgresSQl when trying to use in clause...but i dont know how to overcome this ....any help is greatly appreciated..

 public JPAQuery<Tuple> matchStudentResults(final List<String> studentNames, final List<String> studentCodes) {

 JPAQuery<Tuple> tupleJPAQuery = queryFactory.select(name, code, id,effectiveDate,studentAddress,sharedCourses).from(qStudentProperty).distinct().where(
                code.in(studentCodes).or(name.in(studentNames)).and(effectiveJoiningDate.eq(SimpleDateValidator.getDate(StudentConstants.EFFECTIVE_START_DATE))));

 }

As shown above both the lists studentNames and studentCodes are custom lists with data coming from files and not from the DB....the above query works fine when the lists are having size less than 15K.But fails when the list size is greater...i am new to queryDSL and don't know how to overcome this scenerio..

0 Answers
Related