Cannot view values for the fields in Hibernate Query Fetch on GAE.
Query query = session.createSQLQuery("select s.id,e.firstName, e.middleName, e.lastName, es.title as empStatusTitle,e.transportMode as trModeId," +
" tr.title as trMode" +
" from SecurityPrincipals as s " +
" left join Employee as e on e.userId=s.id " +
" left join EmployeeStatus as es on e.employeeStatus = es.id " +
" left join TransportationModes as tr on e.transportMode = tr.id " +
" where s.id= :userId").setResultTransformer(new AliasToBeanResultTransformer(EmployeeDTO.class));
query.setParameter("userId", userId);
When I call employeeDTO.getTrMode(),employeeDTO.getEmpStatusTitle got all values correctly and running properly in local machine.But when I try to deploy on GAE the value is not getting in the view.jsf but it is there when running locally.I have getters and setters for all these in EmployeeDTO.java. All others like firstName,middleName,lastName has no problem.
My employeeView.jsf is :
<h:outputText value="Transport Mode" />
<h:outputText id="transportMode" value="#{employeeView.employeeDTO.trMode}" style="font-weight:bold" />
<h:outputText value="Employee Status" />
<h:outputText id="employeeStatus" value="#{employeeView.employeeDTO.empStatusTitle}" style="font-weight:bold" />
Since it all works locally, then your code and query are probably fine. And since it does not work on GAE, then there is probably something environmental that’s different. The database is different or not configured properly. You should put some error checking code in to make sure the query is actually working.