-
Example 7
shows the source code for the home interface for the Item EJB
-
One create method
-
Must pass in User EJB of the user who owns this item (e.g. is putting it up for
sale) [the user parameter is pass by reference]
-
The identity of the object is derived from the identity of the owner
-
The primary key of an item consists of
-
The primary key of its owner, and
-
An integer ID assigned to the item by the owner
-
The Item create() method invokes the AllocateOwnedId() method of the User EJB
to get this ID
-
Three finder methods
-
findbyPrimaryKey() and findAllItems() are similar to the User Home interface
-
findItemsByUser() provides the ability to find items according to certain
criteria - in this case whether they are owned by a given individual
|