List result = q.list();
if (result.isEmpty()){
System.out.println("No Projects");
}
else{
for(Object object : result){
Project p = (Project) object;
System.out.println(p.getName()+" worked on by "+p.getEmployees().getName());
}
}
error :
CompanyReports.java:303: cannot find symbol
symbol : method getName()
location: interface java.util.List<Employee>
System.out.println(p.getName()+" worked on by "+p.getEmployees().getName());
^
1 error
Can anyone help what is my stupid mistake here? And how can I deal with it?