Tutorials > Content management > Create a content-managed resource > Creating the new resource
Create entity creation data
Procedure
- In the Enterprise Explorer view, navigate to WebSphereCommerceServerExtensionsData.
- Right-click ejbmodule and select New > Class.
- In the Name field, type ExtendedCatalogDescriptionEntityBeanCreationData.
- In the Package field, type com.mycompany.catalog.objects.
- Click the Add button next to the Interface box.
- In the Implemented Interfaces Selection window, type EntityBeanCreationData into the Choose interfaces field.
- Click OK.
- Click Finish.
- The following variables represent the columns in the EXTCATALOGDSC table. Add the variables to the class:
private java.lang.Long catalog_id; private java.lang.Integer language_id; private java.sql.Timestamp lastModified; private java.lang.String frontImg; private java.lang.String backImg; private java.lang.String sideImg; private java.lang.String topImg;
- Right-click anywhere in the editor and select Source > Generate Setters and Getters....
- In the Generate Getters and Setters window, click Select all to create getter and setter methods for all of the attributes.
- Click OK.
- Implement the method that copies the attribute values from the access bean to the entity creation data.
public void copyFromAccessBean(ExtendedCatalogDescriptionAccessBean accessBean) throws RemoteException, CreateException, FinderException, NamingException{ catalog_id = accessBean.getCatalog_id(); language_id = accessBean.getLanguage_id(); lastModified = accessBean.getLastModified(); frontImg = accessBean.getFrontImg(); backImg = accessBean.getBackImg(); sideImg = accessBean.getSideImg(); topImg = accessBean.getTopImg(); }You will see an error message saying that ExtendedCatalogDescriptionAccessBean cannot be resolved. You can ignore this as it will be created later.
- Press CTRL+SHIFT+O to organize imports. The errors about RemoteException, CreateException, and FinderException should now be gone.
- Save and close the file.