• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question on CMP virtual persistent fields

 
B.Sathish
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?
 
Praveen Kumar Mathaley
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic