Tutorials > Content management > Create a content-managed resource
Create the new resource
Part one shows you how to create a new resource.
Learning objectives
At the end of Part 1, we will be able to perform the following tasks:
- Create a new table representing the new resource.
- Create an entity bean for the new table.
- Create Entity Creation Data.
- Create new ejbCreate and ejbPostCreate methods making use of the Entity Creation Data.
- Create a mapping between the entity bean and the database table.
- Enable optimistic locking for the entity bean.
- Generate an access bean for the entity bean.
2 hours
Lessons in this module
- Create a new table
In this step we will create a new table to represent the new resource.
- Create an entity bean for the new table
The entity bean is created following the steps of the tutorial
- Create entity creation data
- Create new ejbCreate and ejbPostCreate methods
The ejbCreate() method is used to insert a row into the database table and must be added to the ExtendedCatalogDescriptionBean.
- Create a mapping between the entity bean and the database table
- Enable optimistic locking for the entity bean
- Create an access bean for the new table
- Generate deployment code and regenerating the access bean
The code generation utility analyzes the beans to ensure that the EJB specifications of Sun Microsystems are met and it ensures that rules specific to the EJB server are followed. In addition, for each selected enterprise bean, the code-generation tool generates the home and EJBObject (remote) implementations and implementation classes for the home and remote interfaces, as well as the JDBC persister and finder classes for CMP beans. It also generates the Java ORB, stubs, and tie classes required for RMI access over IIOP, as well as stubs for the home and remote interfaces.