Cheers,
N Narayan Singh
______________________________
*CMC Ltd.,
   VISIC Group, Gachibowli,
   Hyderabad- 500019 .
*(o) 040-3000401 Ext: 2166.









-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:jboss-user-admin@;lists.sourceforge.net]On Behalf Of Michael
Angelo Libio
Sent: Thursday, November 14, 2002 6:29 AM
To: [EMAIL PROTECTED]
Subject: [JBoss-user] Help with EJB-QL through Multiple Relationships


I'm trying to create a finder method that navigates through multiple related
entities.  Here's a quick setup of my beans (note: plurals return
collections via the already established relationships)

ClientBean:
  getClientRoles()
  getProjects()

ClientRoles:
  getRole()
  getPerson()
  getClient()

ProjectBean
  getProjectRoles()
  getProject()

ProjectRoleBean
  getRole()
  getPerson()
  getProject()

Person
  getProjectRoles()
  getClientRoles()

Role
  getProjectRoles()
  getClientRoles()

Basically, what I want to do is find all those Clients, for a specific
Person where the Person's role exist in the Person<->ClientRole<->Client
relationships.  Simple enough, but now, I need to also include those Clients
that exist in Person<->ProjectRole<->Project<->Client relationship.  Here's
the EJB-QL I came up with:

  SELECT DISTINCT(c)
  FROM Client As c,
    IN (c.clientRoles) AS cr,
    IN (c.projects) AS p,
    IN (p.projectRoles) AS pr
  WHERE cr.person = ?1
    OR pr.person = ?1

Obviously, this didn't work when I deployed it.  I got an "Error compiling
ejbql" message.  I'm not asking for anyone to write my code for me; just to
get me on the right track.  Any help would be greatly appreciated...I
couldn't find any good examples from the web.  So, if anyone knows of a good
resource (book, url, etc.) let me know.  Thanks again!

_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail



-------------------------------------------------------
This sf.net email is sponsored by: Are you worried about
your web server security? Click here for a FREE Thawte
Apache SSL Guide and answer your Apache SSL security
needs: http://www.gothawte.com/rd523.html
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



-------------------------------------------------------
This sf.net email is sponsored by: Are you worried about 
your web server security? Click here for a FREE Thawte 
Apache SSL Guide and answer your Apache SSL security 
needs: http://www.gothawte.com/rd523.html
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to