Code to get hibernate working