• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB-ql to join tables  RSS feed

 
javaenterprise newbie
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have two tables
Book table with BookId and Name as two of the columns
BooksSales table with BookId and NumberSold being the two columns of interest.

I need to get a report containing the BookId, BookName and number of theses books sold given a bookId. If I used plain sql I would just join these tables. If I use cmp beans with Book and BooksSales tables modelled as two entity beans what would my ejb-ql look like. I couldn't find examples on ejb-ql to join two tables.

Any help would be greatly appreciated.
 
Susanta Chatterjee
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For excellent discussion on this, read the book - "Head First EJB" by Kathy Sierra and Bert Bates.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!