• Post Reply Bookmark Topic Watch Topic
  • New Topic

Polymorphism query in ejb 3 ... pls urgently reply  RSS feed

 
amit taneja
Ranch Hand
Posts: 813
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have one super entity class named as "ManageMasterData" with
@Inheritence (stratergy=InhertenceType=TABLE_PER_CLASS)
and all the fields are there that are common to subclass entity beans


but all the subclass entity beans of above mentioned class have no extra field as all subclass has same fields members but they are refering to different tables so
@Table(name=table_name) is put in subclass entity bean
**as all tables which sub-entity beans refering have same column names.. but different kind of data ...

now i wanted to initiate the particular subclass entitybean using superclass ?
pls tell me how do that and how to write query !!!

give example too !!
 
amit taneja
Ranch Hand
Posts: 813
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey anybody pls tell me how to deal with this issue..

i will appreciate if any body could resolve this issue

thanks
amit
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36446
454
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by amit taneja:
now i wanted to initiate the particular subclass entitybean using superclass ?

I don't follow.

Why can't you just do SuperClass c = new SubClass()?
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
seems to me he wants to do Subclass x = new SuperClass(); which is of course not allowed.
 
amit taneja
Ranch Hand
Posts: 813
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no infact i m already scjp 1.4 with 90%
i do know that basics sir
but its really not working ...

should i copy paste the code here
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!