• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Query ManyToMany tables

 
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I am using JPA & Ejb3, and I bump into in to this query problem.
I have four tables implemented as entities,
process, group, and relation table between them � process_group,
process_execution_Instance which is the information about running a process.

Example
process =1(id), file integrity (name)
group = 1(id),maintenance (name)
process_group 1(process_id),1(group_id) - relation between the process and the group.
process_execution_Instance � 1(id), 1 (process_id),02-04(date)

The relation between process and group is as follows:


I would like to query all process_execution_Instance of group "maintenance" using JPA Namedquery,

Any help will be appreciated,
Thank you.
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It can be something like this


Then in the EJB

 
Sharon whipple
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Erencia
I will try it

i Just found in the JPA roster samples at :http://java.sun.com/javaee/5/docs/tutorial/doc/
an example :



I unfamiliar with the "IN" syntax within the FROM clause.
[ May 01, 2008: Message edited by: Sharon whipple ]
 
Pedro Erencia
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sharon,

The IN is equivalent to an INNER JOIN.
 
reply
    Bookmark Topic Watch Topic
  • New Topic