java - How to join one table with different tables with criteria API? -


i have following classes:

class {     private b b;     // getters/setters } class b {    private c c;    private d d;    // getters/setters } class c {    private boolean outdated;    // getters/setters } class d {    // not important fields    // getters/setters } 

class b connected a, c , d relation 'one-to-one'.

i trying join following tables criteria api.

i have following code:

root<a> root = query.from(a.class); root.join(a_.b)     .join(b_.c)     .join(b_.d); 

but unfortunately code not compile, error on line ".join(b_.d)", because after joining b c cannot use fields of b joining.

the reason why want make such joins because need have condition entity c not outdated (so add 'on' condition it).

does know how solve problem?

root.join(a_.b).join(b_.c) represents c, there no way join "b_.d". need do

root<a> root = query.from(a.class); join<a,b> bjoin = root.join(a_.b); bjoin.join(b_.c); bjoin.join(b_.d); 

Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -