Re: [OJB-developers] Bug in OQLQueryImpl
Brought to you by:
thma
From: Jakob B. <jbr...@ho...> - 2002-05-01 07:07:07
|
hi matthew, EqualToColumnCriteria and SqlCriteria do not have bind variables, BetweenCriteria has two of them. jakob ----- Original Message ----- From: "Matthew Baird" <ma...@so...> To: <obj...@li...> Sent: Wednesday, May 01, 2002 7:36 AM Subject: [OJB-developers] Bug in OQLQueryImpl > > 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 :)) > > |