Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

retrieving a list from a many to many

 
Chris Merani
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok guys, I am struggling with another many to many problem. I have two tables, MATERIAL_RECORD and KEYWORDS tied by a lookup table KEYWORDS_LOOKUP. Netbeans created the JPA entity classes as well as the JPA Controller classes. I am trying to get the application to output the keywords associated with a specific material_record. I have figured out how to get it to tell me how many keywords are associated. I have also figured out how to get it to output the actual list of elements but it outputs them with the keyid instead of the actual "name" (string). Please see my test class below. If you need to see anything else just let me know as I didnt want to clog up the post with too much code.


------------------------------------------------------------------------
OUTPUT:
{[JPA.Keywords[ keyId=9 ], JPA.Keywords[ keyId=10 ]]}
2
JPA.Keywords[ keyId=9 ]
JPA.Keywords[ keyId=10 ]
BUILD SUCCESSFUL (total time: 3 seconds)

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic