• 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

virtual persistent field question

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I noticed that for an entity bean class, it has to be declared abstract since we have to provide the virtual persistent field and map them to the column in the database. Then for encapsulation reason, we implement public getters and setters to return and set the values from outside the class.

Question:
If this is an abstract class, that means someone has to implement the concrete class since we have abstract methods, 'those virtual persistent fields', that need to be implemented. But according to the rule, we don 't have to implement those abstract getters/setters a.k.a. 'virtual persistent fields.' - we're supposed to leave them alone. This is really confusing.. can someone help me with this situation? thank you.
 
author & internet detective
Posts: 41915
910
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
Zul,
When you generate the deployment code, the container implements the abstract class. It also generates ties, stubs and quite a few other classes.

Since you are never instantiating the bean directly as a programmer, you don't need to implement the abstract class.
 
Zul Chewanabas
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you Jeanne. That makes a lot of sense now..so the container implements the abstract class at deployment time. thx
reply
    Bookmark Topic Watch Topic
  • New Topic