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
Post a Comment