This could be a simple Hibernate error but its my first time hitting.
Run this unit test to reproduce.
@test
public void dummyTest() {
//Create yr Patient Object
Patient patient = new Patient(); //Add related metadata to the patient like name.
//Save the patient
Context.getPatientService().savePatient(patient);
//Get all the Patient objects
Context.getPatientService().getAllPatients(); //Oppppss, throws 'java.lang.ClassCastException'
}
If you are asking for help about a runtime error, having a test that does not even compile, is not a good practice. Expecting some one to Add related metadata to the patient like name. as per your comments shows that you are too lazy to even help yourself.
In summary, people are very busy. If you need their attention, make them do as little as possible to get to what you want.