Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

Reperguntando - No entity found for query

No meu codigo desta aula a consulta retorna exceção pedindo o id na classe preço porem ela é apenas relacional

type Exception report

message javax.el.PropertyNotFoundException: Property 'id' not found on type br.com.casadocodigo.loja.models.Preco

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: javax.el.PropertyNotFoundException: Property 'id' not found on type br.com.casadocodigo.loja.models.Preco
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:561)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:477)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:172)
    org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303)
    org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1228)
    org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1011)
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:955)
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
    org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause

javax.el.PropertyNotFoundException: Property 'id' not found on type br.com.casadocodigo.loja.models.Preco
    javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:291)
    javax.el.BeanELResolver$BeanProperties.access$300(BeanELResolver.java:243)
    javax.el.BeanELResolver.property(BeanELResolver.java:378)
    javax.el.BeanELResolver.getValue(BeanELResolver.java:97)
    org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:104)
    org.apache.el.parser.AstValue.getValue(AstValue.java:184)
    org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184)
    org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:950)
    org.apache.jsp.WEB_002dINF.views.produtos.detalhe_jsp._jspx_meth_c_005fforEach_005f0(detalhe_jsp.java:368)
    org.apache.jsp.WEB_002dINF.views.produtos.detalhe_jsp._jspService(detalhe_jsp.java:200)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:439)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:172)
    org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303)
    org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1228)
    org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1011)
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:955)
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
   org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.85 logs.
1 resposta
solução!

Depois de muito pensar, e tentar entender o erro, descrobri que no formulario abaixo, mais especifico na linha

${preco.tipo}

ao inves de preço tipo não sei porque eu coloquei ${preco.id ) .

<form action="/carrinho/add" method="post" class="container">
                <input type="hidden" value="${produto.id}" name="produtoId">
                    <ul id="variants" class="clearfix">

                        <c:forEach items="${produto.precos}" var="preco">
                            <li class="buy-option">
                                <input type="radio" name="tipo" class="variant-radio" id="tipo" value="${preco.tipo}" checked="checked" /> 
                                <label class="variant-label">${preco.tipo}</label> 
                                <small class="compare-at-price">${preco.valor + 10}</small>
                                <p class="variant-price">${preco.valor}</p>
                            </li>
                        </c:forEach>