Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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.
 
Let's get him boys! We'll make him read this tiny ad!
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!