I am having a structure which looks like this:
Code:
public class tableA {
...
@OneToOne
private tableB b;
@OneToMany
@JoinTable(name = "tableA_tableE", joinColumns = @JoinColumn(name = "tableA_id"), inverseJoinColumns = @JoinColumn(name = "tableE_id"))
private List<tableE> es;
...
}
public class tableC {
...
@OneToOne
private tableD d;
}
public class tableE {
...
@OneToMany
private List<tableD> es;
...
}
public class tableD {
...
@ManyToOne
private tableE e;
}
This HQL query to selects rows from tableC given an instance of tableB:
Code:
select obj_ from tableC obj_ where obj_.d.e IN (select obj2_.es from tableA obj2_ where obj2_.b=:parameter)
When executing the query I get this error: Unexpected token: . in statement
The generated SQL has . instead of obj2_es
Can anybody help, please?
Thanks