JAVA: generate loadAll() method