Reputation: 342
I have a Doctor entity. Each doctor has a list of HealthInsurance which is another entity.
My goal is to make a search system based on the HealthInsurance's the user select. I have to get all doctors that has at least 1 HealthInsurance contained in the user health insurance's list. Something like this:
Criteria criteria = session.createCriteria(Doctor.class);
criteria.add(Restrictions.in("healthInsurances", userHealthInsurances));
return criteria.list();
But this code is throwing the following exception: java.sql.SQLException: No value specified for parameter 1.
Is there any way of doing this using Criteria?
Upvotes: 4
Views: 6728