jpa - QueryDSL Issue with any() and InheritanceType.JOINED -


i having issue setting predicate collection utilizing inheritancetype.joined. currenlty using querydsl 3.6.3.

i attempting create predicate against base class follows:

final qcollector collector = qcollector.collector; final jpaquery query = new jpaquery(entitymanager); query.from(collector).where(collector.parents.any().desc.eq("test")); final list<collector> results = query.list(collector); 

this jpql generated:

select collector  collector collector  exists (select 1 collector.parents collector_parents_1f637               collector_parents_1f637.desc = ?1) 

and results in following sql

select collector0_.id id1_1_ collector collector0_ exists (select 1 parent parents1_ collector0_.id=parents1_.parent_id , parents1_1_.desc=?) 

this sql incorrect not join base desc. there missing in jpa mapping building predicate incorrectly?

sample code

@entity @table(name = "base") @inheritance(strategy = inheritancetype.joined) public abstract class base implements serializable {      @column(name = "base_id")     @id     private long id;      @column(name = "code")     private string code;      @column(name = "desc")     private string desc;     ...  @entity @table(name = "parent") @primarykeyjoincolumn(name = "base_id", referencedcolumnname = "base_id")   public class parent extends base {      @column(name = "parent_id")    private long parentid;     ...  @entity@table(name = "collector") public class collector implements serializable {      @column(name = "id")     @id     private long id;      @onetomany(mappedby = "parentid")     private list<parent> parents;     ....  create table base (     base_id numeric(18,0) not null,     code varchar(10),     desc varchar(200),     primary key (base_id) );  create table parent (     base_id numeric(18,0) not null,     parent_id numeric(18,0) not null,     primary key (base_id) );  create table collector (     id numeric(18,0) not null,     parent_id numeric(18,0) not null,     primary key (id) ); 


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

android - Pass an Serializable object in AIDL -