Avoid having a huge collection of ids by calling a DAO.getAll()
Posted
by Michael Bavin
on Stack Overflow
See other posts from Stack Overflow
or by Michael Bavin
Published on 2010-04-08T11:38:19Z
Indexed on
2010/04/08
11:43 UTC
Read the original article
Hit count: 287
Instead of returning a List<Long>
of ids when calling PersonDao.getAll()
we wanted not to have an entire collection of ids in memory.
Seems like returning a org.springframework.jdbc.support.rowset.SqlRowSet
and iterate over this rowset would not hold every object in memory.
The only problem here is i cannot cast this row to my entity.
Is there a better way for this?
© Stack Overflow or respective owner