开发者

Criteria query filter by object type

开发者 https://www.devze.com 2023-02-18 06:48 出处:网络
I\'m using jpa criteria query. Is it possible to filter an entity by the type of some of it\'s atributes?

I'm using jpa criteria query.

Is it possible to filter an entity by the type of some of it's atributes?

let me explain: I have an entity (let's call it Child) that extends from another entity (let's call it Father).

A third entity Entity1 has an attribute Father (which in some cases could also be Child).

Is there some way t开发者_JAVA百科o retrieve only those Entity1 which Father attribute is a Child?

Thanks!


I've just used a subquery of Child , didn't find a better solution.

0

精彩评论

暂无评论...
验证码 换一张
取 消