randomcoding/PartsDbWebApp — Issue #37: Review the findMatching methods in db object classes
Author: randomcoder
Created: 2012-02-04 21:52:55+00:00
State: open
Labels: db

The current implementation of `findMatching(Thing)` has the general contract that it will return the object with the same `id` as the provided `Thing` or if there is not a `Thing` with the same `id` then performs a match on the values of certain fields and returns the 'first' record found. In this case 'first' is non-deterministic as the query is not sorted.

The issue is that a `getMatching()` function should really return __all__ matching records, so maybe the the results should be combined.

For now, the current contract wil suffice, but it might well be worth reviewing this after the initial release.