• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Polymorphism query in ejb 3 ... pls urgently reply

 
Ranch Hand
Posts: 817
  • 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: 817
  • 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
 
author & internet detective
Posts: 40035
809
Eclipse IDE VI Editor Java
  • 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()?
 
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: 817
  • 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
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic