added hibernate to project and able to get data properly.