session queries are replaced with entity manager queries