"Problem" with cross join

#1

At first, this is my first JPA Projekt - and the code should work with Hibernate and JPA, using the specifc DAOs.

Following query string returns no result using ObjectDB - using Hibernate, or EclipseLink this query works fine.

select distinct c from CI c, CIstring s where c.name like :SSTR or (c.id = s.ci.id AND s.text like :SSTR)

The class CI (Confiugration Item):

private String name;
@OneToMany(mappedBy="ci")
private List<CIdata> content;
abstract class CIdata (@Inheritance(strategy=InheritanceType.JOINED)
...
@ManyToOne
private CI ci;

subclass CIstring

private String text;

I am not sure, if this query is JPA conform, but I have'nt a idea how can I retrive the data in one query.

 

#2

Your query is valid and the problem seems to be a bug in ObjectDB (in handling primary key fields in JOIN queries).

Please try the new build (2.0.4_01) that should fix the bug.

The attached test reproduces the problem - its fails with version 2.0.4 and seems to work well with 2.0.4_01.

If you still see issues, please try to demonstrate them by adjusting the attached test.

Thank you for your bug report.

ObjectDB Support

Reply