Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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

Question on CMP virtual persistent fields

 
Ranch Hand
Posts: 372
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In a CMP bean,is it possible to expose the abstract getters and setters in the bean class for the virtual persistent fields as business methods in the component interface?

One page in HFEJB says it is possible to do so, though it is not good practice as it does not follow encapsulation rules.

There is another page that says that business methods in the component interface MUST have concrete implementations in the bean class.

I think these 2 contradict. Which one is true? Is it possible to directly expose the abstract setters and getters to the client through the component interface if I don't have any validation or anything else to do before calling the setters for the virtual persistent fields?
 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can have the getter & setter methods for the cmp virtual fields in the component interface except for setter methods of the primary key,
 
B.Sathish
Ranch Hand
Posts: 372
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Praveen...that makes sense
 
World domination requires a hollowed out volcano with good submarine access. Tiny ads are optional.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic