Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#1471 closed enhancement (fixed)

Implement equals() and hashCode() in all QueryElement implementations

Reported by: Nicklas Nordborg Owned by: Nicklas Nordborg
Priority: major Milestone: BASE 2.16
Component: core Version:
Keywords: Cc:

Description

This is a feature that would be useful since we then don't have to compare Expressions using their string representations. The comparison is needed in the BFS exporter when used from the external program executor to make it possible to check if a given expression has already been added to the export. Right now, we check this by calling Expression.toString() and comparing the result, but it would be better if expressions implemented equals() instead.

Change History (4)

comment:1 by Nicklas Nordborg, 15 years ago

Milestone: BASE 2.16

comment:2 by Nicklas Nordborg, 15 years ago

Owner: changed from everyone to Nicklas Nordborg
Status: newassigned

comment:3 by Nicklas Nordborg, 15 years ago

Resolution: fixed
Status: assignedclosed

(In [5320]) Fixes #1471: Implement equals() and hashCode() in all QueryElement implementations

comment:4 by Nicklas Nordborg, 15 years ago

(In [5321]) References #1471: Implement equals() and hashCode() in all QueryElement implementations

Ouch! It turned out that the IdentitySet I used in AbstractQuery was not a java.util class. It was an internal Hibernate implementation with some peculiar issues (eg. ClassCastException). Since there is no Set implementation using object identity I used the Map implementation instead.

Note: See TracTickets for help on using tickets.