Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
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
Saloon Keeper
Pie
Posts: 18164
53
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