IBM Version 5 manual CustomerInfoWeb project properties, Example 10-13 create source code

Models: Version 5

1 340
Download 340 pages 15.44 Kb
Page 267
Image 267

Figure 10-27 CustomerInfoWeb project properties

You can start now on modifying the CustomerXML file, by doing the following:

￿Open the CustomerXML.java file to start editing it. Modify the import statements to include exactly the following:

import javax.ejb.*; import java.rmi.*;

import registration.Customer; import registration.CustomerKey; import registration.CustomerFactory; import org.w3c.dom.*;

import javax.xml.parsers.*;

￿Implement a create method that constructs a new CustomerFactory, and invoke its create method using Customer bean’s properties, as shown in Example 10-13.

Example 10-13 create source code

protected void create() throws

RemoteException,CreateException { CustomerFactory factory = new CustomerFactory(); registration.Customer ejbean =

factory.create(getBean().getMembership().longValue());

Chapter 10. Development of XML-based Enterprise applications 251

Page 267
Image 267
IBM Version 5 manual CustomerInfoWeb project properties, Example 10-13 create source code