Criteria listing query with restriction on sub entity non primary key issue
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)
?
精彩评论