Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inner Join

 
Deepika Joshi
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EJB 3 in Action, page 377

Category & User entities have many-to-one association. To retrieve all user that match a specific criterion we could try this query:




I think its correct in book.... there is no way to delete the post... so please ignore this doubt....
 
Reza Rahman
author
Ranch Hand
Posts: 580
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deepika,

It is a poorly constructed inner join example. The inner join in this case really serves no function. This is in my list to fix for the second edition.

Thanks,
Reza
 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Just want to make it clear. Should "u.Category c" be "Category c"?
Or "u.Category c" is correct syntax?

But why don't you use "u.category c"? (I guess category is a property of User entity).
 
Deepika Joshi
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just want to make it clear. Should "u.Category c" be "Category c"?
Or "u.Category c" is correct syntax?

But why don't you use "u.category c"? (I guess category is a property of User entity).

I had the same doubt & finally imagined that Category is property of User.... (as in description it says Many-to-One relationship in Entities)
(for author) No offense, but JPQL examples could b easy to understand if corresponding (native) SQL is also given in the book....
I have completed the chapter (JPQL) but I do not have confidence, is there any link for JPQL for some other source.....


thanks...
 
Reza Rahman
author
Ranch Hand
Posts: 580
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deepika,

There is no offense taken. I don't think the JPQL chapter is particularly strong either. You could try the Mike Keith book centered on JPA only.

Regards,
Reza
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic