Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

About Home methods in EJB2.0  RSS feed

 
georgejk
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to know something more about the Home Methods introduced in EJB2.0.
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See this Javaworld article.
 
Dave Landers
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
These are methods you put on your Entity bean Home interface, and implement them in the EntityBean implementation class.
They are for methods that apply to beans of that type, but are not specific to any instance.
For example, say you have an Address entity, and for some reason you need a method to return the count of all addresses in a particular city. You could put a getCountByCity(String city) method on the AddressHome.
 
Rick Hightower
Author
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is an interesting article on home methods...
Home Methods

...
public interface Home extends javax.ejb.EJBHome {
public String hello() throws RemoteException;
public int add(int a, int b) throws RemoteException;
...



...
public class HelloBean extends EntityBean {
public String ejbHomeHello()
{
return "Hello, world";
}
public int ejbHomeAdd(int a, int b)
{
return a + b;
}
...
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!