• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

In EJB 1.1 does Bean Provider create Primary key?

 
Jeff Wachhorst
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know that in EJB 2.0, the bean provider creates the primary key. However, in 1.1, I've read in Wetherbie's notes (see SCEA links) that the container does.
At http://java.sun.com/developer/onlineTraining/EJBIntro/EJBIntro.html, their example of a (EJB 1.1 right?) CMP bean contains:
public Customer ejbCreate(Integer id) {
customerID = id.intValue();
return null;
}
From this, it looks like id is going to be passed in by the home's create() method (which the user calls). customerID is the primary key so it looks like the user is responsible for creating it rather than the container.
This leads me to another question:
If this were EJB 2.0, would customerID have to be Integer and the return type of this ejbCreate(..) be Integer or could it be a primitive type (i.e. int)?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic