Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

In EJB 1.1, does bean provider create primary key?  RSS feed

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, 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)?
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!