Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to add Multiple ManyToOne mapping in single POJO and get records from multiple table?  RSS feed

 
Rocky Menezes
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I have tables Order(orderno,orderdate,suppid)
Supplier(suppid,suppname)
orderdetails(orderdetailid,orderno)
I wanted to get result like this using JPA
orderno,orderdate,suppname,orderdetailid
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Rocky!

You would get better answers if you asked that question in the JPA ORM forum. That's where the experts on JPA hang out. This forum is the one where you can get help on JSF.

Just for information, however, I actually have JSF applications that use JPA to do exactly what you are asking. All I did was code multiple @ManyToOne properties in definition of the entity that was at the top of the working set to be returned. Along with some DAO-level code that forced fetching, where needed.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!