now it works for all hibernate versions