• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

overloading create methods

 
Giju George
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we overload create methods
eg: create(String abc)
create(String abc, int 10) etc...

in (a) Session Beans
(b) Entity Beans ???
 
V Sharma
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stateless Session Bean:
no you can only define ejbCreate()
Reason: To give same behaviour to different instance.

Stateful Session Bean:
Yes

Entity Bean:
Yes
You can also overload the find method except for constraint on

findByPrimaryKey(key)...

Which makes sense So that container does know which is the unique way to get the entity bean.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic