mysql - Cannot get object from database -
I have just one thing I want to get the database, which realized my query, but I get an exception. I have this exception: what you need to really start your class Tashe? Does this work if you just say: Tache tache = null; Batch = (Tache) query.uniqueResult (); Without coding much: Tache binding = new Tache (); @ Override Public Tache getLastSousTache () {session session = HibernateUtil.getSessionFactory (). GetCurrentSession (); Session.beginTransaction (); Select the string sql = "from tache * where idtache = (maximize (idety) tache where soustache is not zero)"; Query query = session.createSQLQuery (SQL); Touch Tachs = New Tash (); Tache = (TESE) query.uniqueResult (); Return tech; }
org.springframework.web.util.NestedServletException: request processing fails; The nested exception is java.lang.ClassCastException: [Ljava.lang.Object; Not be cast com.model.Tache org.springframework.web.servlet.FrameworkServlet.processRequest (FrameworkServlet.java:927) org.springframework.web.servlet.FrameworkServlet.doGet (FrameworkServlet.java:811) javax.servlet.http HttpServlet.service (HttpServlet.java:621) org.springframework.web.servlet.FrameworkServlet.service (FrameworkServlet.java:796) javax.servlet.http.HttpServlet.service (HttpServlet.java:728) org.apache. Tomcat .websocket.server.WsFilter.doFilter (WsFilter.java:51) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal (CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter (once perRequestFilter. java: 107)
Comments
Post a Comment