questions=dao.getNamedQueryResultList("getUnansweredQuestionsByCategory", new Object[]{strUser});
for(Question selectedResumes:questions) {
//do something with the SelectedResumes object
System.out.println("Unanswered::"+selectedResumes.getQuestion());
}
==================================================== =====================-
出现以下错误:
java.lang.ClassCastException:[Ljava.lang.Object;无法在 com.sx.mcqs.service.QuestionService$$FastClassByCGLIB$$cd78275c.invoke 的 com.sx.mcqs.service.QuestionService.findRelatedQuestionsGame(QuestionService.java:142) 上转换为 com.sx.mcqs.model.Question () 在 net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191) 在 org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689) 在 org.springframework.aop.framework .ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) 在 org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) 在 org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) 在org.springframework.aop.framework。