This class casting from java.lang.object to model class doesn't work in any ways. Below is my code.
List<Contactinfo> listStudentInfo = new ArrayList<Contactinfo>();
//listStudentInfo = dataService.getAllStudent(studentInfo);
listStudentInfo = dataService.getStudentInfo();
System.out.println(listStudentInfo.size());
Contactinfo contactinfo = (Contactinfo)listStudentInfo.get(0);
But In hibernate, you don't need join if you have both Entity associated with by @Many-to-one or @One-to-one join annotation. Then you need to select one object only , you will automatically get access to other object via the join. Make sure you keep getter(), setter() method for the joining field. Hope this will clarify the situation.