Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Why finder methods are not static?  RSS feed

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to EJb and just started learning EJb . I just want to know that "Why finder methods are nonstatic?"
Can somebody help me out
Thanks
Deepak
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Finder methods are declared in interfaces. Interfaces cannot have static methods.
 
Deepak Gupta
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply
But In BMP , finder methods , in Entity bean class ,are non static . we can define all the finder methods as static.
then why do we not have static finder methods there??
 
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because the EJB spec leaves open the option of Entity inheritance, something that is not possible with static methods. For instance, in the WebSphere CMP implementation, a finder on a home can bring back a heterogenous collection of both the instances of the bean the home corresponds to and any superclasses of that bean.
Kyle
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Kyle Brown:
Because the EJB spec leaves open the option of Entity inheritance, something that is not possible with static methods. For instance, in the WebSphere CMP implementation, a finder on a home can bring back a heterogenous collection of both the instances of the bean the home corresponds to and any superclasses of that bean.
Kyle



Can you please elaborate on this?
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This article elaborates on the way that it was done in VAJ and WebSphere 3.0/3.5, which is still very close to the way it's implemented in WAS 4.0 and WSAD.
Kyle
[ November 05, 2002: Message edited by: Kyle Brown ]
 
Today you are you, that is turer than true. There is no one alive who is youer than you! - Seuss. Tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!