users@glassfish.java.net

JPA map result query

From: <glassfish_at_javadesktop.org>
Date: Fri, 12 Sep 2008 04:42:25 PDT

I'm developing an application using netbeans and visual java Server faces. I did the job very well when tables have only a simple primary key but when it is a compose primary key I don't know how work with that.
My database have 3 tables, master products(Articulos), master types(Tipos) and a listprices(listaprecios) I can only see data by this way

http://datacentertec.com:8080/PruebaWebApp/

Now i need map this Query

SELECT l.COD_LSP,t.DESC_TIPO,a.COD_ART, a.DESC_ART, l.PRECIO
FROM listaprecios l, Tipos t, Articulos a
WHERE l.TIP_LSP=t.TIPO and l.COD_ART=a.COD_ART

and get something like this:

COD_LSP DESC_TIPO COD_ART DESC_ART PRECIO
======= ======================== ======= ===============
LP001 Tipo de lista de Compras IN1001 Aguas 12.45
LP001 Tipo de lista de Venta IN1002 Alcohol cetílicoss 23.34

My proyect and database is in this link www.datacentertec.com/archivo/proyectoprueba.zip
I really apréciate your help

Regards,
Roberto
[Message sent by forum member 'roberto1073' (roberto1073)]

http://forums.java.net/jive/thread.jspa?messageID=299022