This content has been marked as final.
Show 5 replies
-
1. Re: How To: Fetch all the records from DB in one go?
oguzyalcin.oguzhanyalcin.gazi.edu.tr Jun 1, 2009 1:56 PM (in response to allforjava.allforjava.aol.in)In EntityQuery.java line 160,161
160: if (getMaxResults() != null) 161: query.setMaxResults(getMaxResults() + 1);
if you set MaxResults to null it will not evaluate this if clause so you can achieve your point ;)
-
2. Re: How To: Fetch all the records from DB in one go?
allforjava.allforjava.aol.in Jun 19, 2009 4:14 PM (in response to allforjava.allforjava.aol.in)Hi,
I tried with the above clue however I'm not getting the resultList based on search criteria set vide RESTRICTIONS. What else I need to do?
Code:
public List<Timesheets> getCompleteResultList(){
List<Timesheets> temporaryList = null;
try {
this.setMaxResults(null);
//setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
temporaryList = new ArrayList<Timesheets>(getResultList());
this.setMaxResults(MAX);
} catch (Exception e) {
System.out.println("@TimesheetsList.getCompleteResultList(): "+e);
}
return temporaryList;
}
Thank you in advance! -
3. Re: How To: Fetch all the records from DB in one go?
oguzyalcin.oguzhanyalcin.gazi.edu.tr Jun 21, 2009 12:51 PM (in response to allforjava.allforjava.aol.in)Hi,
In your method you use setMaxResults(MAX) can this be the problem? try removing that line an please use code block format for code entry.
-
4. Re: How To: Fetch all the records from DB in one go?
allforjava.allforjava.aol.in Jun 22, 2009 7:26 AM (in response to allforjava.allforjava.aol.in)Thank you, Oguzhan!
I need to retreive all the records (based on search criteria) vide method 'public List<Timesheets> getCompleteResultList()'only. And I'm using setMaxResults(MAX) to reset the resultList back with the MAX count, after fetching the records.
However, the getResultList() within getCompleteResultList() is not picking the restriction or they are resetted.
Please clarify with what is missing?
-
5. Re: How To: Fetch all the records from DB in one go?
allforjava.allforjava.aol.in Jun 22, 2009 12:27 PM (in response to allforjava.allforjava.aol.in)Solved !
Actually the problem was the restrictions were reset towards navigation from page to another. Used page parameteres and its done!