• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB 2.0 Persistence  RSS feed

 
Arvind Varma
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
EJB 2.0 spec says "Bean provider should provide abstract accessor methods for cmp-fields in Container managed Persistence". In order to satisfy this the bean provider needs to implement an abstract class which is not the actual case. so how is this satisfied by a bean provider?
 
Karthik Guru
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Arvind Varma:
Hi,
the bean provider needs to implement an abstract class which is not the actual case.

Not sure if i get the question. The bean provider, ie you (assumign that you are a developer) has to write an abstract class with abstract methods for persistent fields
Eg:

assuming that the Person entity has a persistent field called "name".
The container will provide the actualy implementation.
 
Arvind Varma
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is right...i do get it but in actual implementation the class we write would be something like this

so how come we (assuming u too are a developer) satisfy the spec...in case we satisfy the spec then the bean class will be an Abstract class..this is where i get confused
[ August 05, 2003: Message edited by: Arvind Varma ]
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The catch is that the EJB Container generates the concrete implementation class based on the deployment descriptors and your abstract class. You write an abstract class with abstract methods and the container generates a class extending your abstract class and implementing the methods.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!