It would be very nice if Hibernate could have better diagnostic output.
A couple of times we have been wasting hours of work because some aspect of the annotations was wrong and we were just clueless about it.
Recently we had an Embeddable class and used annotations on its fields, but forgot to specify the access type FIELDon the embeddable class. (None of the examples show this and intuitively I assumed that the same access type is used for the embedded class as for the embedding class.)
So this is one example:
If annotations are defined on fields, but the access type is PROPERTY than please output an error (and vice versa of course).
Annother example:
If you specify a wrong field attribute name in AttributeOverride, there is no warning whatsoever. Hibernate happily ignores the annotation completely.
Better diagnostics could really save hibernate users lots of work...
|