Fully functional hibernate script