Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

CMP relationship fields  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The spec document[10.3.1] says that 'The accessor methods for the container-managed relationship fields must not be exposed in the remote interface of an entity bean', then, i have the following questions

1. Can the local interface contain methods that in turn accesses the relationship field accessor methods?

2. Can the remote interface contain methods that in turn accesses the
non-relationship field accessor methods?

Thanks.
 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The answer is yes for both questions. The beans participating in a CMR must define local interfaces and the accessor methods that you define in the bean class use the local interface as parameter and return type. As a result, you cannot expose those methods in the remote interface because you are not allowed to expose local interfaces to remote clients.

Nothing prevents you from exposing them in the local interfaces, though. Also, the remote interfaces can expose the non-relationship field accessor methods. But keep in mind that if you are using CMP your accessor methods will be abstract and if you choose to expose them in the component interface you cannot perform additional steps like validation when they are called because the container will provide the implementation of the methods. For that reason, it is recommended that you define and expose your own pair of accessor methods that perform any additional steps and then call the abstract accessor methods.

Regards,
Stefan
[ April 18, 2005: Message edited by: Stefan Guilhen ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!