public class ItemTypeBean implements EntityBean, ItemTypeBase { public Long catalogNo; // .... public IItemType getSummary() { return new ItemTypeSummary( catalogNo.longValue(), name, price, description ); } private PKGenTranslationProxy pk; public Long ejbCreate(String name, int price, String description) throws CreateException { try { if(pk == null) pk = new PKGenTranslationProxy(); this.catalogNo = pk.getNextPKFor("ItemType"); } catch(Exception ex) { System.out.println("ItemTypeBean.ejbCreate(): Error."); ex.printStackTrace(); throw new CreateException("ItemTypeBean.ejbCreate(): Couldn't get a PK"); } // .... } public class CatalogBean implements SessionBean, ICatalog { private ItemTypeHome itemTypeHome; public Collection getAllCatalogItems() { List items = new ArrayList(); try { Collection its = itemTypeHome.findAll(); Iterator it = its.iterator(); while(it.hasNext()) { Object obj = it.next(); ItemType itemType = (ItemType) PortableRemoteObject.narrow(obj, ItemType.class); items.add(itemType.getSummary()); } } catch(Exception ex) { System.out.println("CatalogBean: Error in getAllItems()"); ex.printStackTrace(); } // Can return an empty collection if there's a problem. return items; }