• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Query ManyToMany tables

 
Sharon whipple
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • 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.
 
Pedro Erencia
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
Hi Sharon,

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