-->
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.  [ 4 posts ] 
Author Message
 Post subject: Filtering a collection
PostPosted: Wed Feb 11, 2004 1:50 pm 
Newbie

Joined: Wed Feb 11, 2004 1:45 pm
Posts: 4
Trying to filter a collection. I do get the initial collection of campusLocs below but I hang on the line that creats a new collection of uniqLocs. I dont get any exceptions or anything, jsut hang. Any help will be appreciated. BTW, the application architecture is struts/weblogic8/oracle9i.

session = SessionHelper.getSession();
logger.info("getCampusLocations: B4 findCollection " );
campusLocs = gateway.findCollection("HrRecruitSchedule");
logger.info("getCampusLocations: all locs size: " + campusLocs.size());

Collection uniqLocs = session.filter(campusLocs, "select distinct this.school");
logger.info("getCampusLocations: uniq locs size: " + uniqLocs.size());


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 11, 2004 1:59 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Check the Hibernate log.
Did you implement correctly equals and hashcode

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 11, 2004 4:08 pm 
Newbie

Joined: Wed Feb 11, 2004 1:45 pm
Posts: 4
Yes. I do have the hashcode and equals defined and are listed below. On a side note, the primary key for the table (my hibernate classes/mapings refer to) is ID which is a sequence and this table has events that could happen at a campus lcoation. So as such you can have multiple schools in the table. I was trying to get to get unique/distinct schools from this table to populate my drop down by doing the filter on the original collection.

public boolean equals(Object other) {
if ( !(other instanceof HrRecruitSchedule) ) return false;
HrRecruitSchedule castOther = (HrRecruitSchedule) other;
return new EqualsBuilder()
.append(this.getId(), castOther.getId())
.isEquals();
}

public int hashCode() {
return new HashCodeBuilder()
.append(getId())
.toHashCode();
}


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 11, 2004 5:34 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Try raising the log level and figure out where everything hangs. If necessary, you can allways attatch a debugger and step into the hibernate code.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.