Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List<Project> projects = em.createQuery("SELECT p FROM Project p " +
- "ORDER BY p.startDate desc ", Project.class)
- .getResultStream()
- .limit(10)
- .collect(Collectors.toList());
- projects.stream().sorted((f,s)->f.getName().compareTo(s.getName()))
- .forEach(e -> System.out.printf("Project name: %s%n" +
- " Project Description: %s%n" +
- " Project Start Date:%s%n" +
- " Project End Date: null%n", e.getName()
- , e.getDescription()
- , e.getStartDate()));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement