automatically reattach entities to hibernate session