@Where and eager @ManyToMany makes em.find return null with Oracle9iDialect

Description

A many-to-many relation between class A and class B is annotated with FetchType.EAGER and a @Where that limits what of the entries from table B that should be included depending on if property in B is null.

For HSQL it generates something like this
SELECT
A., A_TO_B., B.*
FROM
A
LEFT OUTER JOIN A_TO_B ON A.id=A_TO_B.a_id
LEFT OUTER JOIN B ON A_TO_B.b_id=B.id AND (B.SOME_PROPERTY IS NULL)
WHERE
A.id = ?

which works correctly, but for oracle9 we get this

SELECT
A., A_TO_B., B.*
FROM
A, A_TO_B, B
WHERE
A.id = A_TO_B.a_id
AND A_TO_B.b_id = B.id
AND ( B.SOME_PROPERTY IS NULL )
AND calendar_event.id = ?

Which makes em.find(A.class, idForAnExistingA) return null if there only is Bs with someProperty=null in the database for the given A (no rows returned from the query).

Not sure how to make a runnable testcase, attached a maven project with annotated classes and code that describes the steps to reproduce but is not runnable as is.

Environment

None

Activity

Show:
Johan Andrén
September 9, 2010, 2:16 PM

It seems like jira ate some ".*":s in the select part of the queries.

Gail Badner
September 13, 2010, 11:06 PM

Is this still an issue in 3.6.0-Beta-4?

Johan Andrén
September 13, 2010, 11:14 PM

I have a hard time trying as we're stuck with much older versions of hibernate (shipped with JBoss 4.2.x series).

Is this a known problem in versions before 3.6?

Brett Meyer
April 7, 2014, 5:41 PM

In an effort to clean up, in bulk, tickets that are most likely out of date, we're transitioning all ORM 3 tickets to an "Awaiting Test Case" state. Please see http://in.relation.to/Bloggers/HibernateORMJIRAPoliciesAndCleanUpTactics for more information.

If this is still a legitimate bug in ORM 4, please provide either a test case that reproduces it or enough detail (entities, mappings, snippets, etc.) to show that it still fails on 4. If nothing is received within 3 months or so, we'll be automatically closing them.

Thank you!

Brett Meyer
July 8, 2014, 3:11 PM

Bulk rejecting stale issues. If this is still a legitimate issue on ORM 4, feel free to comment and attach a test case. I'll address responses case-by-case. Thanks!

Assignee

Unassigned

Reporter

Johan Andrén

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Major
Configure