Hibernate had some diprecated method