Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB QL w/ ManyToMany

 
Bill Shirley
Ranch Hand
Posts: 457
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My SQL is a little weak. You toss in the mutant alien cross with EJB and it confuses me even more. If anyone could give me some insight into this ManyToMany relationship and how to query across it, I would appreciate it.

Some code snippits included. All insert into and retrieve from the DB fine.

 
Bill Shirley
Ranch Hand
Posts: 457
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I ferreted out a result. Or two actually, but I think they're equivalent. If you know of a better or more common solution, please let me know!




either of these requires a slightly different setting of the parameters of the Query before it is invoked:



And, of course, flatting it out into one annotation makes it much harder to understand:


[ March 05, 2008: Message edited by: Bill Shirley ]
[ March 05, 2008: Message edited by: Bill Shirley ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic