hi all. i am new to hibernate.I am using criteria for fetching data from derby DB and one more thing i am using Annotation. Now my problem is i have created a table named SCHOOL from two classes Named School.java and SchoolDetail.java. in School.java class there are 3 fields schoolId(generated value),schoolName,and instance of SchoolDetail. and there are 3 fields in SchoolDetail.java schoolAddress,isPrivate,studentCount. now i am using the following code to fetch data.
Criteria crit = session.createCriteria(School.class); crit.add(Restrictions.eq("studentCount", 1500)); List<School> schoolList = crit.list();
its getting an exception because studentCount field belongs to SchoolDetail.java . can anyone please help in this case....
Thanx in advance..
|