I have a class AppUser;
class AppUser {
private String firstName;
private String lastName;
//-- getters and setters
}
I also have another class Student;
class Student {
private AppUser appUser;
private Date dateOfBirth;
//-- getters and setters
}
How would i search for Student John Doe, firstName John, lastName Doe?
Had it been the date of birth property, i would create a Criteria and add an equality Restriction (Restristions.eq) on the date. How would i do it for lastName and firstName in the AppUser object?
Query:
For using Criteria, check this thread
Also take a look at this page from hibernate docs