Hello,
This Java Request For Enhancement could significantly improve Hibernate and others ORMs (IMHO):
Synopsis: Make reflection more convenient to use
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4810162
With such feature the following pieces of code:
Code:
Criteria crit = session.createCriteria(Cat.class);
crit.add( Expression.eq("color", eg.Color.BLACK ) );
... would look like something like this:
Code:
Criteria crit = session.createCriteria(Cat.class);
crit.add( Expression.eq(Cat::color, eg.Color.BLACK ) );
So it would be possible to get rid of (almost) all those strings in Hibernate methods like Expresion.eq and similar.
Today programming IDEs are not able to treat those strings (eg.: "color") as references to field color of Cat class.
But with this Java enhancement IDEs would be able to index Cat::color and would be able to show us all references to this field.
What do you think about it?
btw:
Vote for this (or similar) RFE, please :)
I’ve already voted for this RFE.
Kind regards,
Adam Wozniak