Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB3 Multiple Entities, Same Table  RSS feed

 
Ravi Kumaaar
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In EJB3, I have a situation where I need to create 2 separate Entities. But both of them should map to the same table. I tried out an example. It works. Just wondering if it would cause issues in a production scenario..
 
Edvins Reisons
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can even map an entire class hierarchy to a single table, which is one of the three commonly used inheritance mapping strategies.
 
Raghu Kodali
author
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
You can check out the following article that we wrote for JDJ based on the work we have done for our book "Beginning EJB 3 Application Development". This article compares different inheritance hierarchy strategies.
http://java.sys-con.com/read/286901.htm

-raghu
Beginning EJB 3 Application Development
 
Debu Panda
author
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is how you can use Single Table Inheritance mapping strategy
http://radio.weblogs.com/0135826/2006/06/08.html#a205

You can download code examples of my book for resources section of http://www.manning.com/panda/

See code examples of chapter 8.


regards
Debu
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!