Entity Beans  «Prev 

Comparing Entity Bean References

Comparing entity bean references


Line 01 Creates an instance for the customer with the custnum 333 and stores the EJBObject reference in variable goofy.
Line 02 Sets the name of the customer to goofy by calling the business method setName().
Line 03 Finds the entity with the custnum 333 and stores the reference to the EJBObject in bean1.
Line 04 Accesses the business method getInfo()to retrieve the data.
Line 05 Using isIdentical(), the reference goofy is compared to bean1. They compare equal, since the two references refer to the same instance.