Tutorials > Content management > Create a content-managed resource > Creating the new resource

< Previous | Next >


Create entity creation data


Procedure

  1. In the Enterprise Explorer view, navigate to WebSphereCommerceServerExtensionsData.

  2. Right-click ejbmodule and select New > Class.

  3. In the Name field, type ExtendedCatalogDescriptionEntityBeanCreationData.

  4. In the Package field, type com.mycompany.catalog.objects.

  5. Click the Add button next to the Interface box.

  6. In the Implemented Interfaces Selection window, type EntityBeanCreationData into the Choose interfaces field.

  7. Click OK.

  8. Click Finish.

  9. 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;
    

  10. Right-click anywhere in the editor and select Source > Generate Setters and Getters....

  11. In the Generate Getters and Setters window, click Select all to create getter and setter methods for all of the attributes.

  12. Click OK.

  13. 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.

  14. Press CTRL+SHIFT+O to organize imports. The errors about RemoteException, CreateException, and FinderException should now be gone.

  15. Save and close the file.

< Previous | Next >


+

Search Tips   |   Advanced Search