Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.1.0
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

Consider the following example:

Foo filter = new Foo();
filter.setId(1337);
List<Foo> found = fooDao.findFiltered(filter);

This does not return a singe Foo but all the currently persisted Foo s (effectively working like a findAll())

Activity

Hide
Gabriele Catania added a comment -

This is due to ExampleTree internally using {org.hibernate.criterion.Example}} to perform filtered searches: Hibernate's Example ignores identifier properties when filtering.
See also:

Show
Gabriele Catania added a comment - This is due to ExampleTree internally using {org.hibernate.criterion.Example}} to perform filtered searches: Hibernate's Example ignores identifier properties when filtering. See also:
Hide
Gabriele Catania added a comment -

Resolved by adding a Restrictions.idEq() on any non-null identifier passed as filter.
The current behaviour of the dao is now:

  1. if the filter has a non-null id, add the restriction
  2. otherwise cycle to associations
    Note that identifier filtering behaviour as currently implemented is not influenced by PropertySelector s.
Show
Gabriele Catania added a comment - Resolved by adding a Restrictions.idEq() on any non-null identifier passed as filter. The current behaviour of the dao is now:
  1. if the filter has a non-null id, add the restriction
  2. otherwise cycle to associations Note that identifier filtering behaviour as currently implemented is not influenced by PropertySelector s.

People

  • Assignee:
    Gabriele Catania
    Reporter:
    Gabriele Catania
Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: