I'm not sure how the Xdoclet code will help you, but a snippet is included
below. At no point in my code do I pass it an id value.
Here is the call I make to create the new record:
PersonLocal newPerson = PersonUtil.getLocalHome().create("first", "middle",
"last");
Here is the create and post create from the bean implementation class:
/**
* Create a new person
*
* @ejb.create-method
*/
public Integer ejbCreate (String lFirstName, String lMiddleName, String
lLastName)
throws CreateException {
setFirstName(lFirstName);
setMiddleName(lMiddleName);
setLastName(lLastName);
return null; //how do I actually get the new id?
}
/**
* Code to run after ejbCreate() has completed
*/
public void ejbPostCreate(String lFirstName, String lMiddleName, String
lLastName) {
}
And here is the only relevant XDoclet generated code from the local home
interface:
public PersonLocal create(java.lang.String lFirstName, java.lang.String
lMiddleName, java.lang.String lLastName)
throws javax.ejb.CreateException;
|