NutzCN Logo
问答 想问一下 执行自定义sql 哪有问题?
发布于 3273天前 作者 qq_722cb381 2348 次浏览 复制 上一个帖子 下一个帖子
标签: dao

String searchKey = String.format("%%%s%%", key);
Sql sql = dao.sqls().create("find.mobileauth.by.list.serchbyexcel");
sql.params().set("searchKey", searchKey);
sql.params().set("keyid", keyid);
sql.setCallback(Sqls.callback.entity());
Entity entity =dao.getEntity(MobileAuth.class);
sql.setEntity(entity);
dao.execute(sql);
return sql.getList(MobileAuth.class);

5 回复

起码来个报错信息,对吗?

01-06 17:34:03.228 DEBUG - [LoggingMethodInterceptor.http-bio-8070-exec-8] [afterInvoke] Obj = [com.nutz.magiccard.module.mobileauth.MobileAuthModule$$NUTZAOP] , Return = null , Method = public com.dgj.utils.entries.Result com.nutz.magiccard.module.mobileauth.MobileAuthModule.download(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,java.lang.String,java.lang.String) throws java.lang.Exception , args = [org.apache.catalina.connector.RequestFacade@4e69f6b0,org.apache.catalina.connector.ResponseFacade@ec2c508,,11]
01-06 17:34:03.232 WARN - [FailProcessor.http-bio-8070-exec-8] Error@/mobileauth/download :
java.lang.ClassCastException: com.nutz.magiccard.bean.mobileauth.MobileAuth cannot be cast to java.util.List
at org.nutz.dao.impl.sql.NutStatement.getList(NutStatement.java:113)
at com.nutz.magiccard.service.mobileauth.impl.MobileAuthService.searchByKeyByExcel(MobileAuthService.java:169)
at com.nutz.magiccard.service.mobileauth.impl.MobileAuthService$$NUTZAOP._aop_invoke(MobileAuthService.java:1)
at org.nutz.aop.InterceptorChain.invoke(InterceptorChain.java:77)
at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:57)
at org.nutz.aop.interceptor.LoggingMethodInterceptor.filter(LoggingMethodInterceptor.java:48)
at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:60)
at com.nutz.magiccard.service.mobileauth.impl.MobileAuthService$$NUTZAOP.searchByKeyByExcel(MobileAuthService.java)
at com.nutz.magiccard.module.mobileauth.MobileAuthModule.getLists(MobileAuthModule.java:301)
at com.nutz.magiccard.module.mobileauth.MobileAuthModule$$NUTZAOP._aop_invoke(MobileAuthModule.java:1)
at org.nutz.aop.InterceptorChain.invoke(InterceptorChain.java:77)
at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:57)
at org.nutz.aop.interceptor.TransactionInterceptor.filter(TransactionInterceptor.java:34)
at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:60)
at com.dgj.nutz.interceptor.ExecutionTimeInterceptor.filter(ExecutionTimeInterceptor.java:28)
at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:60)
at com.dgj.nutz.interceptor.NameSpaceAndSessionInterceptor.filter(NameSpaceAndSessionInterceptor.java:33)
at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:60)
at org.nutz.aop.interceptor.LoggingMethodInterceptor.filter(LoggingMethodInterceptor.java:48)
at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:60)
at com.nutz.magiccard.module.mobileauth.MobileAuthModule$$NUTZAOP.getLists(MobileAuthModule.java)
at com.nutz.magiccard.module.mobileauth.MobileAuthModule.download(MobileAuthModule.java:239)
at com.nutz.magiccard.module.mobileauth.MobileAuthModule$$NUTZAOP._aop_invoke(MobileAuthModule.java:1)
at org.nutz.aop.InterceptorChain.invoke(InterceptorChain.java:77)
at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:57)
at org.nutz.aop.interceptor.TransactionInterceptor.filter(TransactionInterceptor.java:34)
at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:60)
at com.dgj.nutz.interceptor.ExecutionTimeInterceptor.filter(ExecutionTimeInterceptor.java:28)
at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:60)
at com.dgj.nutz.interceptor.NameSpaceAndSessionInterceptor.filter(NameSpaceAndSessionInterceptor.java:33)
at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:60)
at org.nutz.aop.interceptor.LoggingMethodInterceptor.filter(LoggingMethodInterceptor.java:48)
at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:60)
at com.nutz.magiccard.module.mobileauth.MobileAuthModule$$NUTZAOP.download(MobileAuthModule.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:25)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:40)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:113)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:40)
at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:183)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)

回调选错了
应该是entities()

哦 对 这查的是list 我先试试 谢谢

添加回复
请先登陆
回到顶部