I\'m running the following query. It displays an error message. How to solve this error?
ListrouteList=null;
List> compa
Your companyList contains Strings, not Object[].
You should write
List companyList = (List) session.createSQLQuery (
"select name from company where company_id=?", companyId).list();
for (String routeName: companyList) {
vgDetails = new Route();
vgDetails.setRouteName (routeName);
routeList.add(vgDetails);
}