I use in my app set mapping with a given comparator:
Code:
<set name="someSet" inverse="true" cascade="all-delete-orphan" sort="some.Comaparator">
It worked fine in the version 3.1b2, but it stopped in 3.1rc2.
During debugging I found the "getComparator" method in the org.hibernate.mapping.Collection class, which could have a bug:
Code:
public Comparator getComparator() {
if(comparator!=null && comparatorClassName!=null) {
try {
setComparator( (Comparator) ReflectHelper.classForName(
comparatorClassName ).newInstance() );
}
catch (Exception e) {
throw new MappingException( "Could not instantiate comparator class: "+ comparatorClassName + " for collection " + getRole() );
}
}
return comparator;
}
I not sure about it, but for me it looks, that it shoud be:
if(
comparator==null && comparatorClassName!=null)
Greetings and thx for help