Primary Key - User
  • Example 6 shows the source code for the primary key class for the User EJB
  • Must implement the equals() and hashCode() methods
  • Each User EJB is uniquely identified by a login ID
    • The login ID is a String
    • The primary key class is essentially a wrapper around this String value
  • java.lang.String could have been used directly as the primary key class, but having a separate class is a slightly more clear design

Next Slide >>