I can not understand how to make a comparison in hibernate cruteria. There is such a method
@Override public List<PollEvent> getPollForUpdate(IncomingSms incommingSMS) { Criteria criteria = getSession().createCriteria(PollEvent.class); criteria.add(Restrictions.eq("status", 0)); criteria.add(Restrictions.eq("call.callingnum", incommingSMS.getSourceAddress())); return criteria.list(); } It must return a list of objects. But he turns a mistake. swears on criteria.add(Restrictions.eq("call.callingnum", incommingSMS.getSourceAddress()));
In the PollEvent class, PollEvent is a call field here
@OneToOne(fetch = FetchType.EAGER) @JoinColumn(name = "CALL_ID", nullable = false) private Calls call; And he has a field callingnum on which I want to compare
@Column(name = "CALLINGNUM", length = 15) private String callingnum; The error that I get
could not resolve property: call.callingnum of: polls.entety.PollEvent