//get All
public List<Employee> getAllEmployees(){
List<EmployeeEntity> employeeEntities = employeeRepository.findAll();
List<Employee> employees = new ArrayList<>();
for(EmployeeEntity indexValue: employeeEntities){
employees.add(new Employee(indexValue.getId(),indexValue.getFirstName(),indexValue.getLastName()));
}
return employees;
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter