1
Good evening guys, I’m looking to create a namedquery
with a bank appointment.
Follows:
@NamedQuery(name="ListagemProdutosMesa",query="select Produto p FROM Produto p, Pedido pe, Conta c, Pedido_produto pp where pe.id = pp.pedido_id and pp.produto_id = p.id and c.id = pe.conta_id and c.id=:idConta")
Where this table Pedido_produto
is the table created only to reference foreign keys( I think the problem is there).
The funny thing is query
good wheel in the Postgres
and in the Java
is giving error. Someone could help me???
What error? How is your Product table mapped in Java?
– Dherik
Friend, thank you for answering. I got it right away. As I was mapping in java I wasn’t thinking like objects, follow the query: @Namedquery(name="Listrequest",query="select pe.product from Request pe, Account c Where c.id = pe.conta.id and c.numeroMesa =:nMesa and c.situacao = false")
– EA.Jsp.Android
Put as answer to your own question :)
– Dherik