users@glassfish.java.net

EJB QL to SQL mapping

From: <glassfish_at_javadesktop.org>
Date: Mon, 28 Jul 2008 18:10:53 PDT

Hi,
I would like to know how JPA translates EJB QL to underylying SQL.
e.g. object model - parent table Person that has 1-N relationship with dependent table Address and also 1-N with Phone. There is no direct relationship between Address and Phone.
The primary/foreign keys are Personid primary key in Person table and Personid as foreign key in Phone and Address table.
So each Person object can contain multiple Addresses and multiple Phones.

Objective - To retrieve set of Person with their Addresses and Phones where Person.firstName = 'Scott'

What SQL query(s) will be issued by JPA to the underlying database.
[Message sent by forum member 'swaranjitdua' (swaranjitdua)]

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