Home » Support » Forum » Query problem

Query problem

#1

Hi,

Given :

@Entity(name = "Inspiration")
public class Inspiration implements Serializable {
    ....
    @ManyToOne(fetch = FetchType.EAGER)
    protected Atelier atelier;
    ....
}

I have a query :

SELECT i FROM Inspiration i WHERE i.atelier.id = 3

When I run this query I get wrong results - I get Inspiration objects that have atelier object with id = 3 (correct) and atelier objects = null. To make this query right I must change it to :

SELECT i FROM Inspiration i WHERE i.atelier IS NOT NULL AND i.atelier.id = 3

 

Greetings,

Karol Borkowski

#2

Could you please provide a database for running this query?

Build 2.3.7 fixes a JOIN issue that may cause this regression.

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

Ok, we sent you database with ticket #235.

#4

Thank you for this report. Please try build 2.3.7_03 that should fix this regression.

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

Post Reply

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