Bug #173

Handing null as Pageable or Sort parameter to a query method results in incorrect binding

Added by Oliver Gierke 8 months ago. Updated 8 months ago.

Status:Closed Start:12/09/2009
Priority:High Due date:
Assigned to:Oliver Gierke % Done:

100%

Category:Core DAO Spent time: 2.00 hours
Target version:1.1 Estimated time:2.00 hours

Description

The bind(..) method in Parameters checks method parameters by using ClassUtils.isOfType(..) to exclude special parameters bound in other ways (Pageable, Sort). This does not work out for null values provided as it's type can not be checked.

So we should rather walk the method's parameters to decide whether to bind a parameter to the query.

Associated revisions

Revision 8295
Added by Oliver Gierke 8 months ago

  • fixes #173 - binding parameters now works if special types are bound to null
  • refeactored Parameters and extracted binding behaviour to separate class to separate responsibilities
  • changed method signatures of query subsystem accordingly
  • tweaked implementation of bind(..) to correctly skip binding for null special parameters
  • made Parameters more strict in regards of constructor parameters
  • created unit further unit tests

History

Updated by Oliver Gierke 8 months ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Applied in changeset r8295.

Updated by Oliver Gierke 8 months ago

  • Category set to Core DAO

Updated by Oliver Gierke 8 months ago

  • Status changed from Fixed to Closed

Also available in: Atom PDF