Artifacts (ie hbm files and annotated classes) were not able to point to the same entity-name (== class name for annotations) in an AnnotationConfiguration object: a duplicate mapping exception were raised.
I've added an hibernate.artifact property (we need to find a good name), to allow precedence from one artifact over an other.

hibernate.artifact hbm, class (default)
   will prioritize hbm files over annotated classes for the same entity-name.

hibernate.artifact class, hbm
   will prioritize annotated classes over hbm files for the same entity-name.

hibernate.artifact class
   will ignore any hbm file passed to AnnotationConfiguration

This is a much more powerful version of hibernate.archive (slightly diff semantic but same final goal, I'll remove hibernate.archive).
There are a limitation though, you cannot mix annotated classes and hbm files in a mapped class hierarchy.

I'll add ejb3xml when implemented. I think this concept might come to Hibernate core at some point (at least the infrastructure code). But the drawback is that I need to delay all the binding operation till the actual buildSessionFactory() launch, and thus keeping a list of classes and Document to be processed. This consumes more memory (higher peak until the buildSessionFactory call), but its probably not a show stopper.

Well, just to let you know and to help me to find a good configuration property name.

Reply via email to