Home » Support » Forum » Problem with queries on lists with reverse mapping

Problem with queries on lists with reverse mapping

#1

Hi,

In version 2.4.2, when an object in a list is reversed mapped to the owning object, queries are returning objects of types that were not specified in the query.

In the attached example the last test fails because the query returns both TeamA and TeamB objects where only TeamA was specified in query. If the "team" is omitted from the player and targetEntity = Player.class, mappedBy = "team" are removed from Team the query returns the expected result.

TypedQuery<TeamA> query7 = em.createQuery("SELECT t FROM TeamA t JOIN t.squad s where s.name='Mark Wahlberg'", TeamA.class);

List<TeamA> q7results = query7.getResultList();
assertEquals(1, q7results.size());

It looks like the result is not filtered properly when the reverseMapping is used.

Cheers,

Eitan

#2

Thank you for this report. This is fixed in build 2.4.3_01.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Post Reply

To post a reply and/or subscribe to update notifications - please login