124 words

Problem with queries on lists with reverse mapping

#1
2012-09-07 04:50

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

eitane
eitane's picture
Joined on 2011-06-02
User Post #22
#2
2012-09-09 20:44

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

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #1,236

Post Reply

Please read carefully the posting instructions - before posting to the ObjectDB website.

  • You may have to disable pop up blocking in order to use the toolbar (e.g. in Chrome).
  • Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell checker).
  • To insert formatted lines (e.g. Java code, stack trace) - select a style in the toolbar and then insert the text in the new created block.
  • Avoid overflow of published source code examples by breaking long lines.
  • You may mark in paragraph code words (e.g. class names) with the code style (can be applied by ctrl + D).
  • Long stack traces (> 50 lines) and complex source examples (> 100 lines) should be posted as attachments.
Attachments:
Maximum file size: 32 MB
Cancel