Creating a new ejbPostCreate method

Next, you must create a new ejbPostCreate method that has the same input parameters as the new ejbCreate method.

Before you begin

You created a new ejbCreate method and initialized optimistic locking fields in ejbCreate

Procedure

  1. Double-click the yourNewBeanBean class to open it and view its source code.
  2. Create a new ejbPostCreate method with the same input parameters that were used in the new ejbCreate method. To continue the user residence example, you would add the following code to the class:
    
    public void ejbPostCreate(int argUserId, String argHome, byte
    Rooms) 
       throws javax.ejb.CreateException
    {
    }
    
  3. Save your changes.
  4. Proceed to adding access control methods to the bean.