-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Bug in org.hibernate.mapping.Collection?
PostPosted: Thu Nov 10, 2005 12:53 pm 
Newbie

Joined: Mon Nov 22, 2004 5:56 am
Posts: 2
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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 10, 2005 1:17 pm 
Beginner
Beginner

Joined: Tue Apr 05, 2005 4:27 pm
Posts: 40
Location: canada
keep an eye on this issue...

http://opensource2.atlassian.com/projects/hibernate/browse/HHH-1133


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.