Why doesn't hibernate Criteria generics -


is there reason hibernate doesn't use generics? if did save developers lot of casts.

example hibernate 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 become:

customer acustomer = session.load(customer.class, 1l); ... criteria<customer> criteria = session.createcriteria(customer.class); customer acustomer = criteria.uniqueresult(); 

you can find 1 example here how use:
https://community.jboss.org/wiki/genericdataaccessobjects


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -