ibm.com/developerWorks
Presented by developerWorks, your source for great tutorials
in the home interface is listed as shown below:
package com.rickhightower.auth;
import javax.ejb.EJBLocalHome;
import javax.ejb.CreateException;
import javax.ejb.FinderException;
public interface LocalUserHome extends EJBLocalHome {
public LocalUser create (String email, String password)
throws CreateException;
public LocalUser findByPrimaryKey (String email)
throws FinderException;
}
The Create method
Notice that the arguments for the home interfaces create methods match the
arguments for the
ejbCreate()
and
ejbPostCreate()
as any veteran EJB
developer would expect. The full code listing for the entity bean class is listed as
follows:
Listing 2: The code for UserBean
package com.rickhightower.auth;
import javax.ejb.EntityBean;
import javax.ejb.EntityContext;
import javax.ejb.CreateException;
public abstract class UserBean implements EntityBean {
public String ejbCreate(String email, String password)
throws CreateException {
setEmail(email);
setPassword(password);
return null;
}
public void ejbPostCreate(String email, String password) { }
public abstract String getEmail();
public abstract void setEmail(String email);
Page 18 of 48
Introducing EJB CMP/CMR, Part 1 of 2






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

tomcat web hosting

 

Our partners: PHP: Hypertext Preprocessor Best Web Hosting Java Web Hosting Jsp Web Hosting Cheapest Web Hosting

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved