Create a new ejbPostCreate method

Next, create a new ejbPostCreate method that has the same input parameters as the new ejbCreate method. Prerequisite: You created a new ejbCreate method and initialized optimistic locking fields in ejbCreate

  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.


Previous topic:

Initialize optimistic locking fields in ejbCreate
Next topic:

Add access control methods to the bean

Related tasks

Create new entity beans