Finding Bids
  • Look at two find methods only
    • findByPrimaryKey()
    • findBidsByItem()
  • Example 16 shows the source code for finding a Bid by its primary key
    • This is a mandatory finder method for entity beans
  • Very simple
    • Query the DB using the primary key provided
    • Throw exception if no row found
    • Otherwise, return the key
      • Note: key returned, not object
      • EJB container will turn key into object for client

Next Slide >>