开发者

Criteria listing query with restriction on sub entity non primary key issue

开发者 https://www.devze.com 2023-03-19 01:36 出处:网络
I want to use hibernate criteria with restriction on sub entity non key field for listing objects. criteria.add(Restrictions.eq(\"template.orientation\", orientation));

I want to use hibernate criteria with restriction on sub entity non key field for listing objects.

criteria.add(Restrictions.eq("template.orientation", orientation));

where "template.orientation" is a field in articleTemplate.template

when I am trying to run this the following exception fired.

org.hibernate.QueryException: could not resolve property: template.orientation of: com.media.web.bean.Ar开发者_StackOverflowticleTemplate

can you help me?


Do you have the getters and setters in ArticleTemplate? ie: template.getOrientation() and template.setOrientation(Orientation)?

0

精彩评论

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