• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Polymorphism query in ejb 3 ... pls urgently reply

 
Ranch Hand
Posts: 817
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 817
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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()?
 
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 817
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Would you like to try a free sample? Today we are featuring tiny ads:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic