I have entity
@Entity
@Table(name = "CRM_LOG")
public class CrmLog implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private @Getter @Setter Long id;
..........
@OneToOne
private @Getter @Setter CrmUser crmUser;
}
and another entity
@Entity
@Table(name = "CRMUSER")
public class CrmUser implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private Integer groupId;
public Integer getGroupId() {
return groupId;
}
public void setGroupId(Integer groupId) {
this.groupId = groupId;
}
}
and I make hibernate criteria select
criteria.add(Restrictions.in("crmUser.id", selectedIds));
and it work fine. but this criteria is failed
criteria.add(Restrictions.in("crmUser.groupId", filterGroupIds));
I get an error
org.hibernate.QueryException: could not resolve property: crmUser.groupId of: crm.entity.CrmLog