I'm beginning to use org.hibernate.metadata.ClassMetadata
It's very useful having all the information about a persistent class available.
There is still quite a lot of information locked up in the class that isn't accessible through ClassMetadata.
Of course I have my own introspection utilities which examine our persistent classes, so that we can do a lot of automated stuff, but it would be good if we didn't need to - if we could rely on Hibernate's metedata.
So what I'm thinking of is a way of returning all the annotations that were applied either to a Field, or that Field's getter.
Code:
List<Annotation> getPropertyAnnotations(String propName);
List<Annotation>[] getPropertiesAnnotations();
For instance, we have an annotation against a Field that says that Field is the description for that entity (eg, country name, customer name etc) that would be displayed in a combobox/select. We have other annotations too, so we use our own introspection scheme.
I've opened a feature request at
http://opensource.atlassian.com/project ... e/HHH-1908
Anyone care to vote for it? I think it would be useful.