开发者

Hibernate Criteria for elements inside a Set

开发者 https://www.devze.com 2023-01-01 09:05 出处:网络
I have one entity that con开发者_开发百科tains a set of another entity. Entity1 contains Set entityTwos

I have one entity that con开发者_开发百科tains a set of another entity.

Entity1 contains Set entityTwos

I want to create a search criteria for an "id" field inside entityTwos.

I searched, but didn't get any answers. Anybody have an idea?

Thanks, Sri


It was easy. Something like:

criteria.createAlias("entityTwos", "entityTwo");
criteria.add(Restrictions.eq("entityTwo.id", ...));
0

精彩评论

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

关注公众号