Hibernate: select distinct produto0.id as id1_0, produto0.dataLancamento as dataLanc2_0, produto0.descricao as descrica3_0, produto0.paginas as paginas4_0, produto0.sumarioPath as sumarioP5_0, produto0.titulo as titulo6_0, precos1.Produtoid as Produto1_0_0, precos1.tipoPreco as tipoPrec210_, precos1.valor as valor310_ from Produto produto0 inner join Produtoprecos precos1 on produto0.id=precos1.Produtoid where produto0.id=? nov 20, 2017 6:03:12 PM org.apache.catalina.core.ApplicationDispatcher invoke GRAVE: Servlet.service() for servlet [jsp] threw exception java.lang.NullPointerException at br.com.casadocodigo.model.Produto.lambda$0(Produto.java:121) at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174) at java.util.Spliterators$IteratorSpliterator.tryAdvance(Spliterators.java:1812) at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126) at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464) at br.com.casadocodigo.model.Produto.precoPara(Produto.java:121) at br.com.casadocodigo.model.CarrinhoItem.getPreco(CarrinhoItem.java:32) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at javax.el.BeanELResolver.getValue(BeanELResolver.java:94) at org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:110) at org.apache.el.parser.AstValue.getValue(AstValue.java:169) at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184) at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:702) at org.apache.jsp.WEB_002dINF.views.carrinho.itens_jsp._jspx_meth_c_005fforEach_005f0(itens_jsp.java:444) at
linha 121: return precos.stream().filter(preco -> preco.getTipo().equals(tipoPreco)).findFirst().get().getValor();