hibernate - spring data jpa select query for super class field -


i have super class(which not @entity or @mappedsuperclass) , sub-class entty class like:

class {    @elementcollection    protected collection<someentity> someentities;  // getter , setter } 

and

@entity class b extends {           private string name;   //getter , setter } 

i have written custom query select name , someentities like:

@query ("select b.name, b.someentities b b") 

it throws exception in runtime saying unrecognized field someentities.

any solution did mistakes?

if super class not @entity or @mappedsuperclass (any reason this?), field declared in not persistent, not known hibernate, , can not used in queries. if provide use case, providing alternative.


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -