Question

I'm getting the following error: org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of Part.part_id , but I'm not able to use an instance of the part as an object.

String partId = (String)request.getParameter("partid");
Criteria partCriteria = session.createCriteria(PartFeatureVersion.class);
partCriteria.add(Restrictions.eq("part",partId ));


@Entity
@Table(name="PART_FEATURE_VERSION")
public class PartFeatureVersion {
private Part part;

@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="part_id")
public Part getPart() {
    return part;
}
Was it helpful?

Solution

You should use part.id instead of part when building croteria.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top