Why not sleep mode

Is there a reason Hibernate is not using generics? If this were done, it would save developers a lot of castings.

Example hibernation code:

Customer aCustomer = (Customer) session.load(Customer.class, 1L); ... Criteria criteria = session.createCriteria(Customer.class); Customer aCustomer = (Customer) criteria.uniqueResult(); 

With proper use of generics, this will become the following:

 Customer aCustomer = session.load(Customer.class, 1L); ... Criteria<Customer> criteria = session.createCriteria(Customer.class); Customer aCustomer = criteria.uniqueResult(); 
+7
source share
2 answers
0
source

Hibernate has existed since 2001, but in 2005 generics were added. And maybe Hibernate designers are slowly adopting new methods? or maybe they are very concerned about backward compatibility?

0
source

All Articles