hibernate - HQL Criterion with join -


i have use case display list of entities using subset of values in full entity. approach have taken create entitylist class fields appear in list. class mapped same table full entity subset of fields.

using hql, want filter entitylist returned based on fields in full entity. in example below, want entitylist filtered on description field of entity (which in table not in entitylist class).

public interface ithreephasemotorlist { abstract public long getid(); abstract public string getmfg(); abstract public double getpowerunits(); abstract public integer getpoles(); }  public interface ithreephasemotor extends imotor { public abstract long getid(); public abstract void setid(long id); public abstract integer getversion(); public abstract void setversion(integer version); public abstract string getidsrc(); public abstract void setidsrc(string idsrc); public abstract string getdescription(); public abstract void setdescription(string description); public abstract string getmanufacturer(); public abstract void setmanufacturer(string manufacturer); public abstract integer getpoles(); public abstract setpoles(integer poles); } 

if writing sql directly against tables like:

select ithreephasemotorlist.*    ithreephasemotorlist join ithreephasemotor on         ithreephasemotorlist.id = ithreephasemotor.id   ithreephasemotor.description 'test%'; 

is there anyway in hql?

the approach have taken create entitylist class fields appear in list. class mapped same table full entity subset of fields.

this root of problem. don't that. use complete entity query. loading unneeded columns doesn't have significant impact on performance. , if does, execute query selects columns want.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -