Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

create & EJBcreate

 
tilak kumar
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
whether create and EJBcreate are userdefined or predefined.
if they r predefined to which they belong to.
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The clients invoke create() method on the home interface. The container will delegate the call to its correspondent ejbCreate() method on the bean instance. Therefore one must implement as many ejbCreate methods on the bean class as create methods you have defined in the home interface; they also must have the same number and types of input parameters.
Regards.
 
tilak kumar
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is create method is user defined or it is specified in any class.
if it is userdefined why cann't we can have other name
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by tilak kumar:
is create method is user defined or it is specified in any class.
if it is userdefined why cann't we can have other name


As such, the create method is not declared in any of the interfaces that we are required to implement. That is because, there can be any number of overloaded create methods that a bean developer can provide.

But, that doesnt mean that the createXXX() is user-defined, because, we are not allowed to have any name as we like.

So, what is createXXX() and why do we have to name it createXXX()?
It is because, it is ejb spec rule that mandates the bean developer with the responsibility to code a createXXX method. This also means that, it basically should not be a compile time error... rather, it is a deploy time error.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic