deprecated methods replaced sessionregistry from hibernate used