2.1.4
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
Debug level Hibernate log excerpt:
Before I do this, I just need to ask if this is the expected behaviour.
I have one to many mapping, as a Set in the parent. If I
retrieve the same
parent twice, and get two Sets of children (one from each parent) -
which should obviously be logically the same, then use
contains() on one Set with a child from another set, should
it not return true as they both contain same children?
I am getting false, for all elements. I have defined equals()
method on the
children (which are the elements of the set) as "business key"
equals (so it doesn't use the id) and if I manually
compare two elements from different sets, the equals() does
return true. This is all within the same session.
I can post more info but I wanted to know if this is how it
should be before going through all that (and I was unable to
find any kind of release notes on the website to see if this is
a known problem).
|