开发者

Collection property and Projections of Criteria API (Hibernate)

开发者 https://www.devze.com 2023-01-11 23:28 出处:网络
I have two entities that relate to each other as \"many-to-one\". So one type of the entity has a collection of child entities of another type. Is it possible to retrieve that collection property with

I have two entities that relate to each other as "many-to-one". So one type of the entity has a collection of child entities of another type. Is it possible to retrieve that collection property with Projections? I mean smth like

criteria.setProjection( Projections.projectionList() .add( Projections.id() ) .add( Property.forName( "name" ) ) .add( Property.forName( "childEntities" ) ));

where childEntities is a pr开发者_如何学运维operty of the type Set.

0

精彩评论

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