0

I have three entities: Block, Viewand TargetBlockand want to create a JPA Criteria query for the following sql.

select * from Block INNER JOIN TargetBlock tb ON tb.blockID = b.blockID INNER JOIN view v ON tb.viewID = v.viewID

Block has many views and many TargetBlocks.

Alex Turbin
  • 2,554
  • 2
  • 22
  • 35
user942309
  • 61
  • 1
  • 1
  • 6
  • 1
    This is neither a valid Criteria or JPQL query. What is your question exactly? – Perception Nov 28 '12 at 06:51
  • i want to convert this query to a criteria query... the second inner join is joining targetBlock's viewId with viewId from View entity. I am not sure how to add this on condition in criteria query as default is inner join will be blockID. – user942309 Nov 28 '12 at 06:55

1 Answers1

0

For documentation of the Criteria API see,

http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Development/Querying/Criteria#Join

James
  • 17,965
  • 11
  • 91
  • 146