ManyToMany with Filter generates incorrect load SQL

Description

A filter condition for a many-to-many association is added to the where clause instead of to the left outer join on clause when doing a get by ID with eager join fetching. This means that the select returns no records, when there are associated entities, but they are all filtered out.

The example below generates this SQL:

instead of

BTW: createCriteria with ManyToMany association and Filter creates the correct SQL.

Example DBOs:

Example Test using above DBOs: testManyToManyFilterGet fails, while testManyToManyFilterGetAll succeeds.

Environment

None

Assignee

Chris Cranford

Reporter

Martin Vlcek

Fix versions

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Critical
Configure