refactored hibernate3 to hibernate4