[jboss-user] [EJB 3.0] - Re: EJB 3 Required to Override equals & hashCode

waynebaylor do-not-reply at jboss.com
Thu Nov 15 21:34:41 EST 2007


go for logical equality, so if your entity has three fields:

  | @Id
  | @GeneratedValue
  | private int id;
  | 
  | private String firstName;
  | 
  | private String lastName;

then equals/hashCode should be based on first/lastName and not id.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4105293#4105293

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4105293



More information about the jboss-user mailing list