Re: [OJB-developers] Bug in OQLQueryImpl
Brought to you by:
thma
From: Thomas M. <tho...@ho...> - 2002-05-02 04:58:40
|
fixed it ! There have been similar bugs with the BetweenCriteria, which takes two parameters. Jakob did you found a fix for this in the meantime ? Thanks, Thomas Matthew Baird wrote: > During the criteria flattening, to create the bind iterator, all criteria, > regardless of if they have actual bindable criteria or not, are added to the > bind iterator. I spent some time trying to find a rather nasty bug where my > criteria wasn't getting bound correctly and came up with this: > > > private Vector flatten(Criteria crit, Vector acc) > { > Enumeration e = crit.getElements(); > while (e.hasMoreElements()) > { > Object o = e.nextElement(); > if (o instanceof Criteria) > { > Criteria pc = (Criteria) o; > flatten(pc, acc); > } > else > { > // null criteria doesn't have a binding variable. > if (!(o instanceof ojb.broker.query.NullCriteria)) > { > SelectionCriteria c = (SelectionCriteria) o; > acc.add(c); > } > } > } > return acc; > } > > null doesn't have a binding variable, so we skip it. Are there other > criteria types that don't have a bind variable ($X). > > Thomas, could you commit this fix? I'm still getting my CVS access set up > (and figuring out cvs :)) > > > > > |