Mandarax Query After judging whether there is an Answer in the ResultSet

xiaoxiao2021-03-06  103

Note that in the CRM example provided in Mandarax: public discount getdiscount () {try {return (result == null) null: (discount) Result.getResult (discount.class, query_variable);} catch (InferenceException x) {RETURN NULL;}} But actually does not fully explain the problem, but also a JDBC, adopted: if (Result! = Null && result.next) return (discount) Result.getResult (discount.class, query_variable)

Of course, in MANDARAX's manual, it is clear that this is very clear, but today, this is very vivid, even if it is judged! = Null, when Result.getResult (..) is still throw Exception:

java.lang.NullPointerException at org.mandarax.reference.ResolutionInferenceEngine $ 2.getResult (ResolutionInferenceEngine.java:328) at _publish._P_0hehe._index__jsp._jspService (_index__jsp.java:584) at com.caucho.jsp.JavaPage.service (JavaPage .java: 75) at com.caucho.jsp.Page.subservice (Page.java:506) at com.caucho.server.http.FilterChainPage.doFilter (FilterChainPage.java:182) at com.airinbox.album.AlbumServletFilter. doFilter (Unknown Source) at com.airinbox.album.AlbumServletFilter.doFilter (Unknown Source) at com.caucho.server.http.FilterChainFilter.doFilter (FilterChainFilter.java:88) at com.caucho.server.http.Invocation.service (Invocation.java:315) at com.caucho.server.http.CacheInvocation.service (CacheInvocation.java:135) at com.caucho.server.http.HttpRequest.handleRequest (HttpRequest.java:246) at com.caucho. Server.http.httprequest.handleconnection (httprequest.java: 163) at com.caucho.server.tcpcon Nection.run (tcpConnection.java: 139) at java.lang.thread.run (thread.java:595)

转载请注明原文地址:https://www.9cbs.com/read-97206.html

New Post(0)