Mod4j: Modeling for Java using Domain Specific Languages

Refactor equals() and hashCode() methods in domain objects

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.0.1
  • Fix Version/s: 1.1.0
  • Labels:
    None
  • Number of attachments :
    0

Description

Currently removal of elements from a Set does not work.

Here is a listing of what will work or won't work with the different ways to handle equals/hashCode:

  no eq/hC at all eq/hC with the id property eq/hC with buisness key
use in a composite-id No Yes Yes
multiple new instances in set Yes No Yes
equal to same object from other session No Yes Yes
collections intact after saving Yes No Yes

Issue Links

Activity

Hide
Eric Jan Malotaux added a comment -

We chose to not override equals and hashcode. This leads to the least surprise for programmers.

Show
Eric Jan Malotaux added a comment - We chose to not override equals and hashcode. This leads to the least surprise for programmers.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: